Using AppleScript to Launch Excel VBA Macro
Using MS Office 2004 and AppleScript 1.9.3. I want to use AppleScript in MS Entourage to kick off a VBA macro in Excel. But no luck.
To test things, I created an Excel file ("test.xls") with a one-line VBA macro named "test." It just puts up a dialog box with the message "success." I'm calling it from A.S as follows (per the AppleScript Dictionary for Excel 2004):
tell application "Microsoft Excel"
run VB macro "hard disk:users:xxx:desktop:test.xls!test"
end tell
I get two successive error messages:
1. 'test.xls' cannot be accessed. The file may be read-only or you may be trying to access a read-only location."
2. "Microsoft Excel got an error: "hard disk:users:xxx:desktop:test.xls!test" doesn't understand the run VB macro message."
"test" file permissions are -rw-r--r-- and it is sitting right on the desktop.
FWIW, I did not remove the old Office vX yet, but renamed old Excel "Microsoft ExcelOld". I read on some other site that this may cause problems.
This has been endlessly frustrating. HELP!!??
Steve
To test things, I created an Excel file ("test.xls") with a one-line VBA macro named "test." It just puts up a dialog box with the message "success." I'm calling it from A.S as follows (per the AppleScript Dictionary for Excel 2004):
tell application "Microsoft Excel"
run VB macro "hard disk:users:xxx:desktop:test.xls!test"
end tell
I get two successive error messages:
1. 'test.xls' cannot be accessed. The file may be read-only or you may be trying to access a read-only location."
2. "Microsoft Excel got an error: "hard disk:users:xxx:desktop:test.xls!test" doesn't understand the run VB macro message."
"test" file permissions are -rw-r--r-- and it is sitting right on the desktop.
FWIW, I did not remove the old Office vX yet, but renamed old Excel "Microsoft ExcelOld". I read on some other site that this may cause problems.
This has been endlessly frustrating. HELP!!??
Steve
PowerBook G5, Mac OS X (10.3.9)