Contact Us 1-800-596-4880

Execute Excel Macro

Run a macro in an Excel file or sheet and obtain the execution’s result in a variable. You can pass up to 30 variables as arguments to the macro.

Don’t include this action step inside an Excel Session; the Execute Excel Macro runs independently.

Execute Excel Macro requires Microsoft Excel installed on the computer that runs the automation. Otherwise, the action step fails to execute.

Before You Begin

Before using this action step, ensure that:

  • Microsoft Excel is installed on the computer that runs the automation.

Properties

  • Common

    See Common Properties for a description.

  • Source Excel Operation Settings

    • Directory path

      Directory path to the source file

    • Macro

      Macro to run

    • Password protected

      Whether the Excel file is password protected

      If you select this option, specify the password in the wizard.

    • Source file name

      Name of the source file

Inbound Variables

  • Macro

  • Directory path

  • Source file name

  • Password for the excel file

  • {Arg1} replaced by …​ {Arg30} replaced by

  • Is Arg1 used …​ Is Arg30 used

Outbound Variables

  • Result

    Result of the macro’s execution.

  • Executed (Boolean)

    Returns true if the execution of the macro was successful.

Wizard

Specify the Directory path and File name of the Excel file that contains the macro to run.

After specifying the file, select the macro to run from the Macro dropdown menu. This list autopopulates with the macros existing in the specified Excel file.

You can pass up to 30 variables as arguments to the macro by selecting the corresponding checkbox and setting the value.