Run Office:2011 VBA macro from AppleScript (on OS X Yosemite)
I have seen several methods for running macros from AppleScript on the web but none seem to work. This is the one that looks closest to being relevant for Office:mac 2011:
But no matter what I put after run VB macro, the script editor keeps throwing this error:
Syntax Error
Expected end of line, etc. but found identifier.
So I opened the relevant dictionary in the script editor to check that the method exists using File / Open Dictionary, selecting the relevant Microsoft Office:mac application and searching for run VB macro I found this:
This looks like the macro name and optional parameters are supposed to be on separate lines but that throws the same error.
If it's possible to run a macro and this issue is resolved, where can the macro reside? Only in an open document or can it be called within an installed VBA application add-in too?
Mac OS XMicrosoft OfficeVBA
Last Comment
Jamie Garroch (MVP)
8/22/2022 - Mon
strung
Try
tell application "Microsoft PowerPoint"
activate
tell active workbook
run VB macro "myMacroName"
end tell
tell application "Microsoft PowerPoint"
activate
tell active workbook
run VB macro "myMacroName"
end tell