Protection
Protection class
Represents the various types of protection options available for a worksheet.
Properties
| Name | Type | Description |
|---|---|---|
| AllowDeletingColumn | boolean | Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be delete |
| AllowDeletingRow | boolean | Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must |
| AllowFiltering | boolean | Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected. |
| AllowFormattingCell | boolean | Represents if the formatting of cells is allowed on a protected worksheet. |
| AllowFormattingColumn | boolean | Represents if the formatting of columns is allowed on a protected worksheet |
| AllowFormattingRow | boolean | Represents if the formatting of rows is allowed on a protected worksheet |
| AllowInsertingColumn | boolean | Represents if the insertion of columns is allowed on a protected worksheet |
| AllowInsertingHyperlink | boolean | Represents if the insertion of hyperlinks is allowed on a protected worksheet |
| AllowInsertingRow | boolean | Represents if the insertion of rows is allowed on a protected worksheet |
| AllowSorting | boolean | Represents if the sorting option is allowed on a protected worksheet. |
| AllowUsingPivotTable | boolean | Represents if the user is allowed to manipulate pivot tables on a protected worksheet. |
| AllowEditingContent | boolean | Represents if the user is allowed to edit contents of locked cells on a protected worksheet. |
| AllowEditingObject | boolean | Represents if the user is allowed to manipulate drawing objects on a protected worksheet. |
| AllowEditingScenario | boolean | Represents if the user is allowed to edit scenarios on a protected worksheet. |
| AllowSelectingLockedCell | boolean | Represents if the user is allowed to select locked cells on a protected worksheet. |
| AllowSelectingUnlockedCell | boolean | Represents if the user is allowed to select unlocked cells on a protected worksheet. |
| Password | String | Represents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the work |
| IsProtectedWithPassword | boolean | Indicates whether the worksheets is protected with password. |
Methods
| Name | Description |
|---|---|
| copy | Copy protection info. |
| verifyPassword | Verifies password. |
| getPasswordHash | Gets the hash of current password. |
Protection.AllowDeletingColumn property
Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be deleted must be unlocked when the sheet is protected, and “Select unlocked cells” option must be enabled.
Type: boolean
Protection.AllowDeletingRow property
Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must be unlocked when the sheet is protected, and “Select unlocked cells” option must be enabled.
Type: boolean
Protection.AllowFiltering property
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
Type: boolean
Protection.AllowFormattingCell property
Represents if the formatting of cells is allowed on a protected worksheet.
Type: boolean
Protection.AllowFormattingColumn property
Represents if the formatting of columns is allowed on a protected worksheet
Type: boolean
Protection.AllowFormattingRow property
Represents if the formatting of rows is allowed on a protected worksheet
Type: boolean
Protection.AllowInsertingColumn property
Represents if the insertion of columns is allowed on a protected worksheet
Type: boolean
Protection.AllowInsertingHyperlink property
Represents if the insertion of hyperlinks is allowed on a protected worksheet
Type: boolean
Protection.AllowInsertingRow property
Represents if the insertion of rows is allowed on a protected worksheet
Type: boolean
Protection.AllowSorting property
Represents if the sorting option is allowed on a protected worksheet.
Type: boolean
Protection.AllowUsingPivotTable property
Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
Type: boolean
Protection.AllowEditingContent property
Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
Type: boolean
Protection.AllowEditingObject property
Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
Type: boolean
Protection.AllowEditingScenario property
Represents if the user is allowed to edit scenarios on a protected worksheet.
Type: boolean
Protection.AllowSelectingLockedCell property
Represents if the user is allowed to select locked cells on a protected worksheet.
Type: boolean
Protection.AllowSelectingUnlockedCell property
Represents if the user is allowed to select unlocked cells on a protected worksheet.
Type: boolean
Protection.Password property
Represents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook.
Type: String
Protection.IsProtectedWithPassword property
Indicates whether the worksheets is protected with password.
Type: boolean
copy(source)
Copy protection info.
| Parameter | Type | Description |
|---|---|---|
| source | Protection |
verifyPassword(password)
Verifies password.
| Parameter | Type | Description |
|---|---|---|
| password | String | The password. |
getPasswordHash()
Gets the hash of current password.