sheet_management
Rename, delete, copy, hide/unhide, set tab color, or reorder sheets in an Excel workbook.
Instructions
Manage sheets within a workbook (rename, delete, copy, hide/unhide, set tab color, move order).
Args:
action: One of "rename", "delete", "copy", "hide", "unhide", "tab_color", "move".
- "rename": requires new_name.
- "delete": deletes the sheet; destructive.
- "copy": requires new_name for the copy.
- "hide": hides the sheet (cannot hide all visible sheets).
- "unhide": unhides the sheet.
- "tab_color": requires color (6-char hex) to set or "000000" to clear.
- "move": requires offset (int) to shift position.
file_path: Workbook path.
sheet_name: Target sheet name for the action.
new_name: New name for rename/copy.
color: Tab color hex string for "tab_color".
offset: Position offset for "move" (positive = right).
Returns: str or dict: Operation result or metadata.
Raises: ValueError: When required arguments for an action are missing.
Notes:
- Dispatch mapping: "rename"→tools.workbook.rename_sheet, "delete"→tools.workbook.delete_sheet,
"copy"→tools.workbook.copy_sheet, "hide"→tools.workbook.hide_sheet, etc.
- Deletions and moves are destructive operations and should be annotated in external docs and UIs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | ||
| action | Yes | ||
| offset | No | ||
| new_name | No | ||
| file_path | Yes | ||
| sheet_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |