This sample demonstrates how to set protection for a workbook using XlsIO.
You can lock the structure of a workbook, which prevents users from adding or deleting worksheets or from displaying hidden worksheets. You can also prevent users from changing the size or position of worksheet windows. Workbook structure and window protection apply to the entire workbook.
- Protecting a workbook with a password
- Protecting a window or structure from modification
- Removing protection of a workbook with a password
To protect a workbook, point to Protection
on the Tools
menu, and then click Protect Workbook
. You can choose which elements you want to protect (workbook structure, windows, or both) by selecting or clearing the corresponding check boxes.