Skip to content

Run External Macros Action: runExternalMacros

The runExternalMacros action executes a macro function from an external macro file in an Excel workbook. This function is handy for automating complex tasks and workflows that rely on pre-written macros.

Note: Ensure that the file being used is not open during the Case execution to avoid errors or conflicts.

Example: You have an Excel file named salesReport.xlsx, a macro file macros.bas, and a macro function FormatReport that needs to be executed.

Steps to Configure:

  1. Add a new step.
  2. Select SET from the Action dropdown.
  3. Enter a variable name in the Element Key field (e.g., MacroExecutionStatus). This variable will store the operation result (e.g., success or failure).
  4. Click on Form, select Functions, and choose EXCEL Handler Functions from the dropdown.
  5. In the Action field, select runExternalMacros and provide the following parameters:
    • fPath: Specify the path to the Excel file where the macro will run (e.g., C:\Data\salesReport.xlsx).
    • macroFile: Specify the path to the external macro file (e.g., C:\Macros\macros.bas).
    • macroFunction: Specify the macro function name to execute (e.g., FormatReport).
  6. Click Save.

excel-file-operations-runExternalMacros-setup

Outcome on Execution:

  • The command executes the specified macro function from the external macro file in the given Excel workbook.
  • If the operation is successful, the command returns true in the variable defined in the Element Key (e.g., MacroExecutionStatus).
  • If the operation fails (e.g., file not found, invalid macro function, or execution errors), it returns false.
  • This variable can be referenced in later steps of your automation process using the syntax ${VariableName} (e.g., ${MacroExecutionStatus}).

Last updated: May 27, 2026
Back To Top