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
|