Do not undesratnd the error when calling EXcel macro from .vbs script

Z

zigzagdna

I have following Visual BAsic (.vbs) code:
wscript.echo "begin"
set myExcel = CreateObject("Excel.Application")
wscript.echo "before personal"
set myWorkbook = myExcel.Workbooks.Open("C:\Documents and Settings\pmehrotr\Desktop\Local Files\PREM\oraclemonitorlogs\2012\MONITOR.XLSB")
wscript.echo "before macro"
myWorkbook.Run "'MONITOR.XLSB'!kdcallusers"
myEXcel.quit


-----------------
When I run it, it errors at myWorkbook.Run. macro kdcallusers is present in the MONITOR.XLSB file, so I don't know why the error occurs:

begin
before personal
before macro
C:\Documents and Settings\pmehrotr\Desktop\Local Files\PREM\oraclemonitorlogs\20
12\applymacros.vbs(7, 1) Microsoft VBScript runtime error: Object doesn't suppor
t this property or method: 'myWorkbook.Run'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top