This documentation is archived and is not being maintained.

How to: Remove Protection from Worksheets


Some code examples in this topic use the this or Me keyword or the Globals class in a way that is specific to document-level customizations, or they rely on features of document-level customizations such as host controls. These examples can be compiled only if you have the required applications installed. For more information, see Features Available by Product Combination.

The Unprotect method removes protection from a Microsoft Office Excel 2003 worksheet.

The following example uses the variable getPasswordFromUser, which contains a password obtained from the user. It also assumes that you are working with a worksheet named Sheet1.

To unprotect a Worksheet

  • Call the Unprotect method of the worksheet and pass in the password, if required.


See Also