View Single Post
 
Old 07-26-2017, 02:22 AM
mihnea96 mihnea96 is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Apr 2017
Posts: 26
mihnea96 is on a distinguished road
Default Writing VBA code in Excel from VBA Word

Hi,
I'm trying to write some code in VBA Excel from VBA Word and i've tried using the code bellow, but i guess that's not how it's supposed to be done as it doesn't work. Could you kindly help me out, please?


Sub WriteToExcel()
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
With objExcel
.Visible = True
.Workbooks.Add
.VBProject.vbComponents.Add (vbModule)
End With
End Sub
Reply With Quote