Edit

Share via


_Workbook.Protect(Object, Object, Object) Method

Definition

Protects a workbook so that it cannot be modified.

public void Protect (object Password, object Structure, object Windows);
Public Sub Protect (Optional Password As Object, Optional Structure As Object, Optional Windows As Object)

Parameters

Password
Object

Optional Object. A string that specifies a case-sensitive password for the worksheet or workbook. If this argument is omitted, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook. If you forget the password, you cannot unprotect the worksheet or workbook. It's a good idea to keep a list of your passwords and their corresponding document names in a safe place.

Structure
Object

Optional Object. True to protect the structure of the workbook (the relative position of the sheets). The default value is False.

Windows
Object

Optional Object. True to protect the workbook windows. If this argument is omitted, the windows aren’t protected.

Applies to