ExecuteMacro

Estimated reading: 3 minutes 1765 views

This activity allows the user to execute a pre-existing “Macro” method in the specified Excel file. It operates within the “Excel Scope” activity and requires the file format to be “.xlsm”.

Properties

INPUT

MethodName: *Provide the “Macro” method name from the Excel sheet. This parameter accepts values in the “String” data type.

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”
True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

OUTPUT

Result: This parameter allows you to view the execution status of the activity and returns a value in “Boolean.”
True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.

* Represents mandatory fields to execute the workflow. 

What is “Macro” method and why is it needed?

In Excel, the term “macro” refers to a recorded sequence of actions or a set of Visual Basic for Applications (VBA) code that automates tasks.

Benefits:

1. Macros can automate repetitive tasks in Excel, such as data formatting, calculations, or data import/export. 
2. It is useful for performing complex calculations or data manipulations that may be impractical or error-prone to do manually.
3. It can create user interfaces (forms or dialog boxes) to interact with Excel users, making it easier for non-technical users to perform specific tasks.

How to create “Macro” in Excel sheet?

1. Open or create a blank excel sheet.
2. Now, select the “View” menu on the top of the sheet.
a. Here, you will find the “Macro’s” as the last option on the Menu.
3. Select the “Macro’s” drop-down menu, it will display a context menu.
a. Here we are going to choose the “View Macros” from the drop-down.
b. You can also record the steps that needs to be automated using the “Record Macro” option and provide the name in the “ExecuteMacro” activity.
4. Once you click on the “View Macros” option, a dialog box will appear on the screen.
a. Here, provide a name for the “Macro” in the box as “Welcome Message”.
b. Now, the “Create” option will be enabled, click on it to write the code.
c. The VBA code window appears on the screen.
d. Here I am providing a sample VBA code as “MsgBox “Hello Everyone! Welcome to Robility !””.
e. Now, save “Excel with macro enabled workbook extension” and close it.
5. That’s it, a simple Macro code has been created. 

Share this Doc

ExecuteMacro

Or copy link

CONTENTS