Results 1 to 1 of 1

Thread: Call publisher macro from vbscript

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2013
    Posts
    7

    Call publisher macro from vbscript

    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
    Last edited by pamghag; Dec 19th, 2013 at 12:44 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width