'Declaration
Public Sub Protect( _ Optional ByVal protection As WorksheetProtection, _ Optional ByVal password As String _ )
'Usage
Dim instance As Worksheet Dim protection As WorksheetProtection Dim password As String instance.Protect(protection, password)
public void Protect( WorksheetProtection protection, string password )
Parameters
- protection
The WorksheetProtection object that lets you select which actions can be carried out on a protected Worksheet.
When set to null, the default WorksheetProtection object will be used, which will allow only two actions to be carried out : selecting locked and unlocked Cells.
- password
The password that will be used to protect the Worksheet.
Note that the same password must be used to Unprotect the Worksheet. However, you can protect a Worksheet without using a password. The default setting is, in fact, null, which sets no password for the Protection.