Create New Excel File
office_create_excelCreate a new Excel spreadsheet with specified headers, data rows, and optional sheet name and column widths.
Instructions
Create a new Excel (.xlsx) file with headers and data.
Args:
filePath (string): Path where the new Excel file will be created
headers (array of strings): Column headers
rows (array of arrays): Data rows
sheetName (string, optional): Sheet name (default: "Sheet1")
columnWidths (array of numbers, optional): Custom column widths
Examples:
Use when: "Create a new spreadsheet for the project budget"
Use when: "Generate an Excel report with employee data"
Don't use when: The file already exists and you want to append data (use office_write_excel instead)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path for the new Excel file (e.g., './budget.xlsx') | |
| headers | Yes | Column headers (e.g., ['Name', 'Age', 'Department']) | |
| rows | Yes | Data rows (e.g., [['Alice', 30, 'Engineering'], ['Bob', 25, 'Design']]) | |
| sheetName | No | Sheet name (default: Sheet1) | Sheet1 |
| columnWidths | No | Custom column widths |