# Worksheet Protection

> Protect worksheets with SheetProtection or the Protect Sheet dialog: passwords, allowed actions, locked cells, hidden formulas and rejected edits in code.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Sheet Control > Spreadsheet Documents > Worksheet Protection
- **830 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/spreadsheets/protection/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/spreadsheets/protection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/spreadsheets/protection/llms-full.txt

---

Worksheet protection restricts the supported editing commands of a worksheet, so that users of a form can fill in its input cells but not change its formulas. Protection is an editing policy of the document. It is separate from authentication and server-side authorization, which remain the job of your application.

### How Protection Works

Two settings work together:

- **Cell formatting** marks cells as locked, or their formulas as hidden: the **Locked** and **Hide Formulas** settings in the Protection section of [Format Cells](https://docs.textcontrol.com/tx-sheet-control/spreadsheet-editor/format-cells/llms-full.txt).
- **Sheet-level protection** enables the policy: **Protect Sheet** on the **Review** tab, or in code [Worksheet.protection](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/worksheet/protection-property/llms-full.txt), which returns the [SheetProtection](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/sheetprotection/llms-full.txt) of the worksheet with its [protect](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/sheetprotection/protect-method/llms-full.txt) and [unprotect](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/sheetprotection/unprotect-method/llms-full.txt) methods.

The [SheetProtectionSettings](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetprotectionsettings/llms-full.txt) and [ProtectionOptions](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/protectionoptions/llms-full.txt) references describe the allowed actions, such as sorting, filtering or inserting rows on a protected worksheet.

### Protect a Form

1. Unlock the intended input cells.
2. Keep the calculated cells protected.
3. Apply the supported protection settings.
4. Test typing, paste, fill, structural edits and object manipulation under that policy.

### Choose Protection in the Dialog

Select **Review → Protect Sheet**. The **Password** section accepts a password and confirmation. The **Permissions** section groups switches for selection, formatting, rows and columns, data and objects. Opening either section closes the other, and the long permission list scrolls without moving the dialog actions.

![Protect Sheet with selection and formatting permissions arranged as aligned switches](https://docs.textcontrol.com/assets/img/tx-sheet-control/protect-sheet-dialog.26025971.webp)

Choose **Apply** to enable the chosen policy or **Cancel** to leave the worksheet unchanged. Passwords must match before protection is applied. To remove protection, use the same command and supply the existing password when required. Cell locking and formula hiding still belong to Format Cells.

### Handle Rejected Changes in Code

Operations can reject changes to protected cells and unsupported structural changes. Handle the exception and show a useful message in your application. Do not bypass validation by replacing undocumented document fields. Supported mutations, undo and the transaction rules remain in effect.

A protected document can still be read or exported, according to the public APIs and the host policy you choose.

### What Protection Does Not Secure

> Warning
>
> **Not Encryption.** Protection is not encryption of all document data. Do not present it as a security boundary against a user who can download the workbook.

A UI viewer policy, such as the dashboard viewer, similarly prevents authoring interaction, but it does not replace permission checks on the data sent to that viewer. Use host authorization for file access, application data queries and the disclosure of source rows.

Configure PDF security settings, such as [PdfSecurityOptions](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/pdfsecurityoptions/llms-full.txt), independently when appropriate, and validate their behavior with the target readers.

### Next Steps

- [Data Validation](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/validation/llms-full.txt): constrain the values users enter in the unlocked cells.
- [Format Cells Dialog](https://docs.textcontrol.com/tx-sheet-control/spreadsheet-editor/format-cells/#protection-describe-protected-cell-behavior): set Locked and Hide Formulas for the selected cells.
- [Dashboard Viewer](https://docs.textcontrol.com/tx-sheet-control/dashboards/viewer/llms-full.txt): publish a dashboard without authoring controls.
- [Host Security and File Handling](https://docs.textcontrol.com/tx-sheet-control/deployment/security/llms-full.txt): secure file access, uploads and data in the host application.

---

## Nearby

- **Previous:** [Comments, Notes and Hyperlinks](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/comments/llms-full.txt)
- **Next:** [Pivot Tables](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pivot-tables/llms-full.txt)
