# Excel Write

**ExcelWrite** adds a row of data to an Excel spreadsheet file. The row is added to the bottom of a specified sheet, optionally above a defined footer section.

{% hint style="info" %}
Note:

This function supports files that have been created using Microsoft Excel 2007 or later (.xlsx file extension). You do not need to have Excel installed to use this function.
{% endhint %}

***

### Properties <a href="#properties" id="properties"></a>

#### File path <a href="#file-path" id="file-path"></a>

The file path to the xlsx file to write to.

#### File does not exist <a href="#file-does-not-exist" id="file-does-not-exist"></a>

The action to take when the specified file does not exist.

Options:

* *Create file* creates a blank spreadsheet file to write to.
* *Copy template* copies the template file to the destination file path before adding the row.
* *Throw exception* will stop the process and report an error.

#### Template file <a href="#template-file" id="template-file"></a>

The file path to a xlsx file to copy when no file exists at the destination file path.

Only displayed when the *File does not exist* option is set to 'Copy template'.

#### Sheet name <a href="#sheet-name" id="sheet-name"></a>

The name of the sheet to write to. If the file does not contain a sheet with the specified name, a new sheet with that name will be created.

The number of rows to leave at the bottom of the sheet. The row will be inserted at the specified number of lines above the bottom of the sheet.

#### Values <a href="#values" id="values"></a>

The collection of values to insert into the new row.

Click the ... icon to open the **Row Editor**, which can be used to add *Column-Value* pairs.

***

### Links <a href="#links" id="links"></a>

{% hint style="warning" %}

#### Formula Recalculation

The Excel plugin does not support programmatic recalculation of formula cells. After writing data using the ExcelWrite function, open the Excel file to trigger automatic recalculation of all formula cells. Function values are only calculated by Excel and trigger once the workbook is opened.

**Data Formatting Requirements**

Format cells containing formula dependencies correctly before saving:

* **Set explicit data types** when writing data programmatically to ensure proper formula recalculation
* Ensure data is entered in the correct format when inputting data into cells
* **Format cells as appropriate types** (Number, General) rather than text
* **Avoid text formatting for numeric data** as this prevents formula recalculation

This ensures formulas recalculate correctly when the file opens in Excel.
{% endhint %}

[Office Open XML file format](https://en.wikipedia.org/wiki/Office_Open_XML)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.linx.software/reference/plugins/excel/content/excelwrite.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
