Read Excel File
office_read_excelRead Excel (.xlsx) data using file path, optional sheet name, and cell range. Outputs headers and rows in a structured format.
Instructions
Read data from an Excel (.xlsx) file.
Args:
filePath (string): Absolute or relative path to the Excel file
sheetName (string, optional): Name of the sheet to read. Defaults to first sheet
range (string, optional): Cell range to read, e.g. "A1:C10". Reads all data if not specified
Returns: { "sheetName": string, "headers": string[], "rows": object[], "totalRows": number, "totalColumns": number }
Examples:
Use when: "Read the sales data from report.xlsx"
Use when: "What are the column headers in Sheet2 of data.xlsx?"
Don't use when: You need to write data to Excel (use office_write_excel instead)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the Excel file (e.g., 'C:/data/report.xlsx' or './report.xlsx') | |
| sheetName | No | Sheet name to read (defaults to first sheet) | |
| range | No | Cell range like 'A1:C10' (reads all if not specified) |