UiPath Activities

Invoke VBA

UiPath.Excel.Activities.InvokeVBA

Invokes a macro from an external file containing VBA code and runs it against an Excel file. This activity can run macros on any type of Excel file, such as .xls and .xlsx. Can only be used in the Excel Application Scope activity.

Important!

In order for this activity to work, Trust Access to the VBA project object model must be enabled from Excel (File > Options > Trust Center > Trust Center Settings > Macro Settings > Select the Trust Access to the VBA project object model check box).

Properties

Common

  • DisplayName - The display name of the activity.

Input

  • Code File Path - The path to the macro file which contains the VBA Sub/Function definitions. This field supports only strings or String variables.
  • Entry Method Name - The Sub/Function name that is to be invoked. Must be present in the macro file supplied in the Code File Path property.
  • Entry Method Parameters - A list of up to 30 parameters that can be passed to the entry method. This field supports only IEnumerable<object> variables.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.

Output

  • Output Value - The value returned by the execution of the invoked code, if any. This output is retrieved as Object variables.

Example of using the Invoke VBA Activity

To exemplify how to use this activity, we have built an automation project which scrapes data related to Google stock prices, creates a graph in Excel and saves the graph as an image.
 
 
Download example


Invoke VBA


Suggested Edits are limited on API Reference Pages

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