protect_sheet
Protect an Excel sheet to prevent editing of locked cells, with optional password and permissions for formatting, sorting, or filtering.
Instructions
Protect a sheet so locked cells cannot be edited in Excel.
All cells are locked by default — use set_cell_locked(range, locked=false) BEFORE protecting to keep specific cells editable. The allow_* flags let users still format, sort, or filter while protected. A password (optional) is required to unprotect in Excel; note this is Excel's standard sheet protection, a deterrent rather than encryption.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet | No | ||
| password | No | ||
| session_id | Yes | ||
| allow_sorting | No | ||
| allow_filtering | No | ||
| allow_formatting | No | ||
| allow_select_locked_cells | No |