> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/write-excel-file.md).

# Write excel file

### Write excel file

Write excel file is the action used to write or update a specific value into a designated cell in an Excel file (`.xlsx` or `.xls`) based on the specified row and column position.

#### Configuration parameters:

* File Path: The absolute path to the Excel file where data needs to be written (For example: `D:\GPM\data.xlsx`).
* Sheet index: The position of the sheet where data needs to be written, starting from 0 *(The first sheet is `0`, the second sheet is `1`...)*.
* Column Name or Index: The position of the column where data needs to be written. You can specify it in two ways:
  * By letter: `A`, `B`, `C`, `D`...
  * By index number, starting from 1 *(Column A is `1`, Column B is `2`...)*.
* Row Index: The position of the row where data needs to be written, starting from 1 *(Row 1 is `1`, Row 2 is `2`...)*.
* Value: The text content (or variable containing data) that you want to write into that Excel cell.

#### Practical example: Update the status of the account match for each row of the running Profile

When you run a multithreaded script (running multiple profiles at the same time), each profile will be assigned system variables by the GPM Automate system for identification: the variable for the input Excel file path (`$inputExcelFileLocation`) and the row number of data that the profile is handling (`$inputExcelCurrentRow`).

Suppose you want the script to automatically write the word `"Success"` into column C (Status) corresponding to the correct row of that profile in the Excel file after successfully logging in:

* Configuration:
  * File Path: Pass the system variable `$inputExcelFileLocation`.
  * Sheet index: `0` *(Write to the first sheet)*.
  * Column Name or Index: `C` *(Status column)*.
  * Row Index: Pass the system variable `$inputExcelCurrentRow` *(The system automatically understands the corresponding row for each profile, for example, profile 1 running row 2 will write to row 2, profile 2 running row 3 will write to row 3)*.
  * Value: Enter the string content `"Success"` (or your log variable).

Result: The script will automatically update the results synchronously and accurately into the Excel file in real-time without fear of being overwritten or misaligned between data rows across threads.

<figure><img src="/files/IMBZM6Uq9DGXMIUBRILQ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/X8M3aluViLOk1vE8MCTb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/b7iuE6bqMs88kM1cZDga" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/write-excel-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
