Activities
latest
false
Banner background image
Productivity Activities
Last updated Apr 15, 2024

Execute Macro

UiPath.Excel.Activities.ExecuteMacro

Execute the macro within a workbook. The Workbook file needs to be a Macro-Enabled Workbook. Changes are immediately saved. Can only be used in the Excel Application Scope or Use Excel File activities.

Properties

Input
  • MacroName - The name of the macro to be executed. Only String variables and strings are supported.

    Note: Strings must be placed between quotation marks.
  • Macro Parameters - Enables you to pass parameters when executing the macro. This field supports only IEnumerable<object> variables.
Common
  • DisplayName - The display name of the activity.
  • ContinueOnError - Specifies if the automation should continue even when the activity throws an error. This field only supports Boolean values (True, False). The default value is False. As a result, if the field is blank and an error is thrown, the execution of the project stops. If the value is set to True, the execution of the project continues regardless of any error.

    Note: If this activity is included in Try Catch and the value of the ContinueOnError property is True, no error is caught when the project is executed.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
Output
  • Macro Output - The value returned by the execution of the macro, if any. This output is retrieved as Object variables.

Example of Using the Execute Macro Activity

To exemplify how to use this activity, we have built an automation project that initializes a macro, asks the user for its name and executes the macro.

  • Properties
  • Example of Using the Execute Macro Activity

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.