> 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-guide/file-and-folder/write-excel-file.md).

# Write excel file

The Write excel file action is 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.

🎥 For more instructional videos: [Here](https://youtu.be/EH7olDLAb9c).

#### Configuration parameters:

* File Path: The absolute path to the Excel file where data needs to be written (e.g., `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 account status corresponding to each row of the running Profile

When you run a multi-threaded script (running multiple profiles at the same time), each profile will be assigned predefined 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 text `"Success"` into column C (Status) corresponding to the correct row of that profile in the Excel file after successfully completing the login step:

* 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 `"Success"` (or the variable containing your log).

Result: The script will automatically update the results synchronously and accurately into the Excel file in real-time without the risk of overwriting or misaligning data rows between threads.

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-e25bdb92e3972de7473ed26c1d2d0c3d568ebb05%2Fff-11.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-c41a7d78a28f78002d6247f505e97c83c3b1b71f%2Fff-11b.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-bf3fcc1ad04c59111c0b806d8de8634a05400390%2Fff-11c.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
