Run macro
Run a VBA macro, with up to 10 arguments, in a macro-enabled workbook (a file, or a workbook open in an Excel session, unsaved changes included) and optionally save.
Command in the Excel desktop toolkit · id ooa.excel_desktop/run_macro · 8 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Path | File | No | Workbook (.xlsm/.xlsb/.xls); not needed when a session is given. | |
| Macro | String | Yes | Macro name. | |
| Arguments | List | No | Arguments passed to the macro (text). | |
| Save | Boolean | No | true | Save the workbook afterwards. |
| Timeout (seconds) | Number | No | 600 | Maximum run time. |
| Password | Credential | No | Password needed to open the workbook; passed to Excel through the environment, not the command line. | |
| Visible | Boolean | No | false | Show the Excel window while the agent works, e.g. to watch a macro; hidden by default. |
| Session | String | No | An Excel session open in this run: the step works on that workbook as it is now, changes not yet saved included; the path is not needed then (G3). |
Outputs
| Output | Type | What it is |
|---|---|---|
| result | String | Value returned by the macro (for Functions), as text. |