TX Sheet Control

Worksheet Protection

Topic

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.
  • Sheet-level protection enables the policy: Protect Sheet on the Review tab, or in code Worksheet.protection, which returns the SheetProtection of the worksheet with its protect and unprotect methods.

The SheetProtectionSettings and ProtectionOptions 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

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, independently when appropriate, and validate their behavior with the target readers.

Next Steps