[]
Protects a workbook so that it cannot be modified.
public void Protect(bool structure = true, bool windows = false)
Public Sub Protect(Optional [structure] As Boolean = True, Optional windows As Boolean = False)
Type | Name | Description |
---|---|---|
bool | structure | True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets). |
bool | windows | True to prevent users from moving, resizing, or closing the workbook window, or hide/unhide windows. This option is available only in Excel 2007, Excel 2010, Excel for Mac 2011, and Excel 2016 for Mac. |
Protects a workbook so that it cannot be modified.
public void Protect(string password, bool structure = true, bool windows = false)
Public Sub Protect(password As String, Optional [structure] As Boolean = True, Optional windows As Boolean = False)
Type | Name | Description |
---|---|---|
string | password | Password to protect the workbook. |
bool | structure | True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets). |
bool | windows | True to prevent users from moving, resizing, or closing the workbook window, or hide/unhide windows. This option is available only in Excel 2007, Excel 2010, Excel for Mac 2011, and Excel 2016 for Mac. |