---
schema_version: "1"
id: 9732324c5346cf608059527fa2dc6f320dc034ad3f2afc9409782c1e17559fba
title: Write to Excel File
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/rpa-builder/latest/toolbox-excel-operations-write-to-excel-file.md
canonical_url: https://docs.mulesoft.com/rpa-builder/latest/toolbox-excel-operations-write-to-excel-file
source_site: docs.mulesoft.com
content_type: documentation
content_hash: bcbac9b7f932acc479c050c031708e0c92844a52b94466be0a4d37a91ecbbf9e
description: MuleSoft Documentation Site
release: "6.7"
latest: true
---
---
product: RPA Builder
version: 6.7
is-latest-version: true
---

# Write to Excel File

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

Use the _Write to Excel File_ action step if you want to write the content you have read from an
Excel file using the _Read from Excel File_ action step either to the same or a different
destination file.

The _Write to Excel File_ action step can only be used inside an Excel Session. Specify the
destination file in the [Excel Session](https://docs.mulesoft.com/rpa-builder/latest/toolbox-excel-operations-excel-session).

## Properties

**Excel Operation Settings**

- **Add Sheet name if doesn’t exist** If you select the checkbox here, the sheet will be created new
  if it does not already exist.

- **Column** This is where you enter the column to which you are writing. You can enter letters or
  numbers in this field. If you enter a number, this will correspond to the number of the column in
  the Excel file.

  - Example: Instead of A for column A, you can enter a 1 for column A, a 2 for column B (instead of
    the letter B), and so on.

- **Overwrite content** This is where you determine whether a cell, row or column which already has
  content is overwritten with new content.

- **Range** (drop-down selection, default: Cell) There are three different modes available:

  - **Cell** If you select _Cell_, the text will be written to a specific cell.

  - **Row** If you select _Row_, the text will be written to a specific row.

  - **Column** If you select _Column_, the text will be written to a specific column.

- **Row** This is where you enter the precise cell or row number to which text is to be written.

- **Sheet name** Name of the spreadsheet. Under Properties you can only enter the name directly,
  unlike in the _Write to Excel File_ [Wizard](#wizard).

- **Text to write** This is where you enter the free text that will populate the cell, row or
  column.

- **Write value as** Here you can see whether the data in a cell is written as text or number.

## Inbound Variables

- **Sheet name** Name of the spreadsheet.

- **Column** This is where you enter the column to which you are writing. You can enter letters or
  numbers in this field. If you enter a number, this will correspond to the number of the column in
  the Excel file.

- **Row** This is where you enter the precise cell or row number to which text is to be written.

- **Text to write** This is where you enter the free text that will populate the cell, row or
  column.

- **Array to write** This variable is only used in Row and Column mode. It accepts an array as well
  as a string in CSV format.

## Outbound Variables

**IsWritten** (Bool) This is how you check whether the text has been successfully written to a
specific cell, row or column. The result is _True_ if the text was written successfully to the
destination file.

## Wizard

The **Sheet name** field is for selecting the spreadsheet to which text should be written. You can
type directly into the input field, select an existing sheet from the drop-down list or connect with
a Pin Variable. The drop-down list contains all the sheets saved within the Excel file.

If you add a checkmark next to **Add sheet if it doesn’t exist**, the sheet will be created new if
it doesn’t already exist. You can also connect here with a Pin Variable.

In **Excel Mode** you specify via the drop-down list whether to write to a cell, a row or an entire
column. You can enter letters or numbers as a value or connect with a Pin Variable.

Under Write value as you specify whether the data in a cell is to be written as text or number. This
function is only active if you have selected the Cell mode under Excel mode.

This is useful to avoid errors in calculations. If you enter a number and select Write value as
**Number**, the value is treated as a number in the Excel sheet. The original formatting of the cell
in the target file is retained.

In the **Text to write** field you can enter free text which is to be written to the Excel file or
you can insert text via a Pin Variable. **Text to write** appears if you have selected **Cell**
mode. In the Row and Column modes you will find the option **Array to write** at this point.

Selecting the checkbox next to **Overwrite content with text** will overwrite a pre-populated cell,
row or column with new content. You can also connect here with a Pin Variable.
