Hi,
I want to call a publisher macro using vbscript. I can open an existing publisher file using the script. But when i try to call the macro using "Run" command, it say "Invalid function".
Following is the code I am trying to run.
Option Explicit
Dim xlApp1, xlApp2, xlBook
Set xlApp1 = CreateObject("Excel.Application")
Set xlApp2 = CreateObject("Publisher.Application")
Set xlBook = xlApp1.Workbooks.Open("C:\Users\Pramod\Desktop\BRICS Weekly\BRICS Weekly.xlsm", 0, True)
xlApp1.Run "Process"
xlApp2.Open "C:\Users\Pramod\Desktop\BRICS Weekly\BRICS Global Markets Weekly Digest Template.pub"
xlApp2.Run "Generate_Pub"
Set xlBook = Nothing
Set xlApp1 = Nothing
WScript.Echo "Finished."
WScript.Quit
Can anyone please help.
PG
I want to call a publisher macro using vbscript. I can open an existing publisher file using the script. But when i try to call the macro using "Run" command, it say "Invalid function".
Following is the code I am trying to run.
Option Explicit
Dim xlApp1, xlApp2, xlBook
Set xlApp1 = CreateObject("Excel.Application")
Set xlApp2 = CreateObject("Publisher.Application")
Set xlBook = xlApp1.Workbooks.Open("C:\Users\Pramod\Desktop\BRICS Weekly\BRICS Weekly.xlsm", 0, True)
xlApp1.Run "Process"
xlApp2.Open "C:\Users\Pramod\Desktop\BRICS Weekly\BRICS Global Markets Weekly Digest Template.pub"
xlApp2.Run "Generate_Pub"
Set xlBook = Nothing
Set xlApp1 = Nothing
WScript.Echo "Finished."
WScript.Quit
Can anyone please help.
PG