Trying to find out how to call a Macro from the command line within a pptm file on Macosx using Microsoft Powerpoint for Mac 2011 Version 14.7.3 on Mac OS Sierra I found some suggestions to use Applescript.
suggest:
tell application "Microsoft PowerPoint"
activate
tell active workbook
run VB macro "myMacroName"
end tell
which doesn't work for me.
https://lists.apple.com/archives/applescript-users/2013/Jan/msg00216.html suggests:
osascript << EOF
tell application "Microsoft Powerpoint"
activate
open ":Users:me:folder:macros.pptm"
run VB macro macro name "check" list of parameters {"i", 1}
--quit
end tell
EOF
which gives the error message:
128:187: execution error: „Microsoft PowerPoint“ hat einen Fehler erhalten: Fortfahren nicht möglich: run VB macro. (-1708)
I tried the same with Microsoft Excel according to:
using the following bash script:
osascript << EOF
tell application "Microsoft Excel"
activate
open ":Users:me:folder:check.xlsm"
run VB macro "Blatt1.check"
quit
end tell
EOF
which works.
What do I need to do to get the powerpoint equivalent working?
Correct syntax for PowerPoint is :
tell application "Microsoft PowerPoint"
activate
run VB macro macro name "myMacroName"
end tell
Assuming that front PowerPoint document contains the macro.