Protect Workbook Dialog
The Protect Structure and Windows dialog allows end-users to protect the workbook using an optional password.
Add the Changes ribbon group to enable the Protect Workbook button, which invokes the target dialog. Refer to the Create a Simple Spreadsheet Application topic for details on how to provide the Ribbon UI for the SpreadsheetControl.
In a protected workbook, this button displays the “Unprotect Workbook“ caption, which invokes a simple dialog that prompts for a password or unlocks the workbook if no password was set.
Checking the dialog check boxes enables the following types of protection:
- Structure - prevents other users from moving, deleting, adding, hiding and renaming worksheets, as well as displaying hidden worksheets;
- Windows - restricts changes to the window’s position by freezing/unfreezing panes.
Tip
Use the IWorkbook.Protect method to protect a workbook’s structure and windows in code, or the IWorkbook.Unprotect method to remove protection.