Protection

Protection class

Represents the various types of protection options available for a worksheet.

Properties

NameTypeDescription
AllowDeletingColumnbooleanRepresents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be delete
AllowDeletingRowbooleanRepresents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must
AllowFilteringbooleanRepresents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
AllowFormattingCellbooleanRepresents if the formatting of cells is allowed on a protected worksheet.
AllowFormattingColumnbooleanRepresents if the formatting of columns is allowed on a protected worksheet
AllowFormattingRowbooleanRepresents if the formatting of rows is allowed on a protected worksheet
AllowInsertingColumnbooleanRepresents if the insertion of columns is allowed on a protected worksheet
AllowInsertingHyperlinkbooleanRepresents if the insertion of hyperlinks is allowed on a protected worksheet
AllowInsertingRowbooleanRepresents if the insertion of rows is allowed on a protected worksheet
AllowSortingbooleanRepresents if the sorting option is allowed on a protected worksheet.
AllowUsingPivotTablebooleanRepresents if the user is allowed to manipulate pivot tables on a protected worksheet.
AllowEditingContentbooleanRepresents if the user is allowed to edit contents of locked cells on a protected worksheet.
AllowEditingObjectbooleanRepresents if the user is allowed to manipulate drawing objects on a protected worksheet.
AllowEditingScenariobooleanRepresents if the user is allowed to edit scenarios on a protected worksheet.
AllowSelectingLockedCellbooleanRepresents if the user is allowed to select locked cells on a protected worksheet.
AllowSelectingUnlockedCellbooleanRepresents if the user is allowed to select unlocked cells on a protected worksheet.
PasswordStringRepresents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the work
IsProtectedWithPasswordbooleanIndicates whether the worksheets is protected with password.

Methods

NameDescription
copyCopy protection info.
verifyPasswordVerifies password.
getPasswordHashGets 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

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.

ParameterTypeDescription
sourceProtection

verifyPassword(password)

Verifies password.

ParameterTypeDescription
passwordStringThe password.

getPasswordHash()

Gets the hash of current password.