Skip to main content

Run macro

Open a macro-enabled presentation, run a VBA macro with up to 5 text arguments, return its result and optionally save. A macro that stops with an error is reported straight away with its message.

Command in the PowerPoint desktop toolkit · id ooa.powerpoint_desktop/run_macro · 7 inputs (2 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
PathFileYesPresentation with macros (.pptm, .ppsm, .ppt).
MacroStringYesMacro name, optionally with its module.
ArgumentsListNoUp to 5 arguments, passed to the macro as text.
SaveBooleanNofalseSave the presentation in place afterwards (when save_as is empty).
Save asFileNoSave to this file instead of the opened one.
OverwriteBooleanNotrueReplace save_as when it exists; false stops with POWERPOINT_DESKTOP.EXISTS.
Timeout (seconds)NumberNo600Maximum run time.

Outputs​

OutputTypeWhat it is
resultStringValue the macro returned (for a Function), as text; empty for a Sub.