execute_vba
Run VBA code in open Excel workbooks to automate tasks, process data, or customize functionality. Code executes within temporary modules that are automatically cleaned up.
Instructions
Execute VBA code in an open workbook (live Excel only, cannot use with closed files). Code is wrapped in a Sub automatically if needed. MsgBox calls are stripped. Temp modules are cleaned up after execution.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workbook | Yes | Workbook name | |
| code | Yes | VBA code to execute | |
| sheet | No | Sheet to activate before execution |