Write Data to Excel
office_write_excelWrite or append data to an existing Excel file. Choose the sheet and starting cell for placement.
Instructions
Write or append data to an existing Excel (.xlsx) file.
Args:
filePath (string): Path to the Excel file
data (array of arrays): 2D array of values to write
sheetName (string, optional): Target sheet name (default: "Sheet1")
startCell (string, optional): Starting cell, e.g. "A1" (default: "A1")
Examples:
Use when: "Add these numbers to the existing budget.xlsx"
Use when: "Write the updated inventory list to Sheet2 of data.xlsx starting at B3"
Don't use when: You need to create a new Excel file (use office_create_excel instead)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the Excel file | |
| data | Yes | 2D array of values to write (e.g., [["Name", "Age"], ["Alice", 30]]) | |
| sheetName | No | Sheet name to write to (default: Sheet1) | Sheet1 |
| startCell | No | Starting cell position (default: A1) | A1 |