excel_rename_sheet
Rename an Excel sheet in a .xlsx file. Validates the new name and preserves cell contents.
Instructions
Rename a sheet in the workbook.
Cell contents are preserved across the rename
(VAL-EXCEL-042). Renaming a sheet to its own name is a
no-op (the file is still saved, but the sheet names are
unchanged — VAL-EXCEL-041).
Args:
path: Path to an existing .xlsx.
old_name: Current name of the sheet to rename.
new_name: Desired new name. Must be non-empty and free of
Excel-forbidden characters.
folder: Optional base folder for relative paths.
Returns:
{"ok": True}.
Raises:
OfficeMCPError: ERR_FILE_NOT_FOUND if the file is
missing, ERR_SHEET_NOT_FOUND for an unknown
old_name, ERR_INVALID_PARAMS when new_name
is empty, contains forbidden characters, or already
exists as another sheet, ERR_UNSUPPORTED_FMT for
non-.xlsx extensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| old_name | Yes | ||
| new_name | Yes | ||
| folder | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||