UiPath Activities

The UiPath Activities Guide

Run Macro

UiPath.Excel.Activities.Business.ExecuteMacroX

Executes a specified macro within a macro-enabled workbook. You can pass macro arguments and save the output of the macro execution. The activity can be used with an Excel file selected for a parent Use Excel File activity or with the Project Notebook.

Configuring the Activity

In the Body of the Activity

  • Source workbook - Click Plus plus button on the right side of the field, and then select a workbook with the .xslm extension where to run the macro. Alternatively, you can select Open in Advanced Editor and enter a VB expression.
  • Macro name - Click Plus plus button on the right side of the field, and then select Text to enter the macro name in the Text Builder. Alternatively, you can use one of the other options in the menu to indicate the macro name:
    • Data from the Project Notebook, a parent Excel file or Outlook account. For example, select a cell in an Excel file that contains the macro name.
    • Use Saved Value - Select a value in the form of a macro name that you previously saved for later use in the project.
    • Ask when run - Prompt for a name when the project is executed.
    • Open in Advanced Editor - Enter a VB expression.
  • Output to - If the execution of the macro returns a value, click Plus plus button on the right side of the field, and then use one of the options in the menu to indicate where to save the value:
    • Save to the Project Notebook or a parent Excel file. For example, you can save to a cell in an Excel file.
    • Save for Later Use - Save the output for later use in your project as input for another activity.
    • Open in Advanced Editor - Enter a VB expression.
  • Add Macro Argument - Click this button to add an argument to use when executing the macro. Add as many arguments as are required by the macro.

Macro Argument Options

  • Argument value - Click Plus plus button on the right side of the field, and then use one of the other options in the menu to add an argument value:
    • Data from the Project Notebook, a parent Excel file or Outlook account. For example, select a cell in an Excel file, or a field in a selected Outlook email that contains the value.
    • Use Saved Value - Select a value that you previously saved for later use in the project.
    • Text - Enter text in the Text Builder.
    • Number - Enter a numeric value.
    • Ask when run - Prompt for an argument when the project is executed.
    • Open in Advanced Editor - Enter a VB expression.

In the Properties Panel

Common

  • DisplayName - The name displayed for the activity in the Designer panel.

Input

Misc

  • Private - If selected, the data used in the activity is not logged by StudioX.

Output

Updated 24 days ago


Run Macro


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.