protection
Protect or unprotect Excel sheets, cells, and workbooks with customizable permissions to control editing access.
Instructions
Sheet and workbook protection utilities.
Args: action: One of "protect_sheet", "unprotect_sheet", "protect_cells", "protect_workbook", "unprotect_workbook". file_path: Workbook path. sheet_name: Sheet name for sheet-scoped operations. password: Optional password string used for protection/unprotection. locked_range: Range to lock for "protect_cells". unlocked_ranges: List of ranges allowed for edits. allow_*: Flags controlling allowed operations on protected sheets.
Returns: str: Result message.
Notes: - Protect/unprotect modify workbook security. Warn users about lost passwords.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| password | No | ||
| file_path | Yes | ||
| allow_sort | No | ||
| sheet_name | No | ||
| allow_filter | No | ||
| lock_windows | No | ||
| locked_range | No | ||
| lock_structure | No | ||
| unlocked_ranges | No | ||
| allow_delete_rows | No | ||
| allow_insert_rows | No | ||
| allow_delete_columns | No | ||
| allow_insert_columns | No | ||
| allow_formatting_rows | No | ||
| allow_formatting_cells | No | ||
| allow_formatting_columns | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |