How To Execute Macro in UiPath

To automate few excel tasks, we might sometimes consider macros during our RPA implementation.

let’s see how to execute a macro through UiPath…!!!

Example

Implementation using UiPath :

Let us implement a workflow to create serial numbers in excel file according to the user using a macro code.

( Please ignore the macro code if you don’t understand it, because our goal here is to learn the integration rather than the macro code )

image

(This code will create the serial numbers starting from the active cell)

Step 1:
Drag “ Input Dialogue Box ” activity into the designer panel and store the user provide data into a variable.

image

image

Step 2:
Drag “ Excel application scope ” activity into the designer panel and pass the excel file to it which contain the macro code in it.

image

image

Step 3:
Drag “ Execute macro ” activity into the designer and supply the Macro Name and Macro Parameters to it.

Here:
MacroName: “AddSerialNumbers”
MacroParameters: {userInput} (The function here accepts only one argument)

image

image

Step 4:
Finally, execute the workflow

image

Hope you like it.

Happy learning !!!******

1 Like