Unprotect Method

Applies To

Chart Object, DialogSheet Object, Module Object, Workbook Object, Worksheet Object.

Description

Removes protection from a sheet or workbook. This method has no effect if the sheet or workbook is not protected.

Syntax

object.Unprotect(password)

object

Required. The object to which this method applies.

password

Optional. A string giving the case-sensitive password to use to unprotect the sheet or workbook. If the sheet or workbook is not protected with a password, this argument is ignored. On a sheet, if you omit this argument and the sheet was protected with a password, you will be prompted for the password. On a workbook, if you omit this argument and the workbook was protected with a password, the method fails.

Remarks

If you forget the password, you cannot unprotect the sheet or workbook. It's a good idea to keep a list of your passwords and their corresponding document names in a safe place.

See Also

Locked Property, Protect Method, ProtectContents Property, ProtectDrawingObjects Property.

Example

This example removes protection from the active workbook.


ActiveWorkbook.Unprotect