A model carries one password, the access password. It protects the model against being opened in the [[Invantive Control for Excel/User Interface/Model Editor|model editor]], and it is at the same time the password with which Invantive Control for Excel protects and unprotects the workbook and its worksheets. The password is stored encrypted in the [[Invantive Control for Excel/Repository/Repository|repository]] of the workbook.
Protection therefore belongs to the model, not to Microsoft Excel. A modeller who protects a worksheet through "Review", "Protect Sheet" in Excel itself sets a password which Invantive Control for Excel does not know, upon which the two drift apart and the product can no longer open the worksheet on behalf of the model user. Set protection in the model editor instead.
## Unprotecting on Opening
When a workbook with a model is opened, the product unprotects the workbook and every visible worksheet with the access password, and it makes the layout worksheet visible. This is intended: blocks are filled, rows are inserted and removed, and styling is applied, none of which is possible on a protected worksheet. Worksheets which are hidden are skipped.
A workbook whose repository can not be read is not unprotected; the attempt then ends with `itgenuty279`.
## Protecting Again
Protection is restored with the same password. Protecting a worksheet withholds all of the following from the model user: formatting cells, columns and rows, inserting and deleting columns and rows, inserting hyperlinks, sorting, filtering and using pivot tables. Contents, drawing objects and scenarios are protected as well.
Cells which the model user must be able to fill are excluded from protection by the model itself, so a protected worksheet is still a worksheet in which the intended values can be entered. Protection is applied only where it is not already in force, since protecting a worksheet is slow. When Microsoft Excel does not accept the protection, the attempt ends with `itgenuty277` naming the worksheet.
## Saving
Storing the repository in the workbook fails with `itgenuty361` when Microsoft Excel is in cell edit mode or is recalculating, and also when the password on the workbook does not match the access password of the model. Leave the cell being edited, wait for the calculation to finish, and check that the passwords agree.