---
schema_version: "1"
id: f50fc07a5648ed20e6812dcfdebeffcadc40035a12261f170bde2f3ecf249921
title: Execute Excel Macro
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/latest/toolbox-excel-operations-execute-excel-macro.md
canonical_url: https://docs.mulesoft.com/rpa-builder/latest/toolbox-excel-operations-execute-excel-macro
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0b6cbe2b7f7c582e211fd4af4a0c31ddc59e2b5d90ac9f23b1568ca909a8ae28
description: MuleSoft Documentation Site
release: "6.7"
latest: true
---
---
product: RPA Builder
version: 6.7
is-latest-version: true
---

# Execute Excel Macro

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Run a macro in an Excel file or sheet and obtain the execution’s result in a variable. You can pass
up to 30 variables as arguments to the macro.

Don’t include this action step inside an Excel Session; the Execute Excel Macro runs independently.

Execute Excel Macro requires Microsoft Excel installed on the computer that runs the automation.
Otherwise, the action step fails to execute.

## Before You Begin

Before using this action step, ensure that:

- Microsoft Excel is installed on the computer that runs the automation.

## Properties

- **Common**

  See [Common Properties](https://docs.mulesoft.com/rpa-builder/latest/common-properties) for a description.

- **Source Excel Operation Settings**

  - **Directory path**

    Directory path to the source file

  - **Macro**

    Macro to run

  - **Password protected**

    Whether the Excel file is password protected

    If you select this option, specify the password in the wizard.

  - **Source file name**

    Name of the source file

## Inbound Variables

- **Macro**

- **Directory path**

- **Source file name**

- **Password for the excel file**

- **{Arg1} replaced by** …​ **{Arg30} replaced by**

- **Is Arg1 used** …​ **Is Arg30 used**

## Outbound Variables

- **Result**

  Result of the macro’s execution.

- **Executed** (Boolean)

  Returns `true` if the execution of the macro was successful.

## Wizard

Specify the **Directory path** and **File name** of the Excel file that contains the macro to run.

After specifying the file, select the macro to run from the **Macro** dropdown menu. This list
autopopulates with the macros existing in the specified Excel file.

You can pass up to 30 variables as arguments to the macro by selecting the corresponding checkbox
and setting the value.

## See Also

- [Excel Operations](https://docs.mulesoft.com/rpa-builder/latest/toolbox-excel-operations)

- [Excel Session](https://docs.mulesoft.com/rpa-builder/latest/toolbox-excel-operations-excel-session)
