run_macro
Execute a VBA macro in Excel and retrieve the result. Supports passing arguments and specifying a workbook.
Instructions
Run a VBA macro in Excel and return its result.
Args: macro_name: Macro name (e.g. 'MyMacro' or 'Module1.MyMacro'). workbook: Workbook name. If omitted, Excel resolves globally. args: Optional arguments to pass to the macro.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"macro_name": "<macro_name>"
},
"name": "run_macro"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macro_name | Yes | ||
| workbook | No | ||
| args | No |