[]
Protects a workbook so that it cannot be modified.
bool Protect(WorkbookLocks locks, string password = null)
Function Protect(locks As WorkbookLocks, Optional password As String = Nothing) As Boolean
| Type | Name | Description |
|---|---|---|
| WorkbookLocks | locks | A WorkbookLocks value indicates which data will be protected. |
| string | password | A string value that specifies a case-sensitive password for the worksheet or workbook. |
| Type | Description |
|---|---|
| bool |
|
Note that support for WorkbookLocks and password is limited to reading and writing the OpenXML file. All options of WorkbookLocks have same effect in runtime.