WorksheetProtection Class
Protection settings. Supported in XLSX, XLSB and XLS only.
- Inheritance:
- WorksheetProtection
Remarks
Properties in this class are simply written to Excel file and have no effect on the behavior of this library. For more information on worksheet protection, consult Microsoft Excel documentation.
Properties
AllowDeletingColumns
Gets or sets if deleting columns is allowed.
public bool AllowDeletingColumns { get; set; }
Public Property AllowDeletingColumns As Boolean
Property Value
AllowDeletingRows
Gets or sets if deleting rows is allowed.
Property Value
AllowEditingObjects
Gets or sets if editing objects is allowed.
Property Value
AllowEditingScenarios
Gets or sets if editing scenarios is allowed.
public bool AllowEditingScenarios { get; set; }
Public Property AllowEditingScenarios As Boolean
Property Value
AllowFormattingCells
Gets or sets if formatting cells is allowed.
public bool AllowFormattingCells { get; set; }
Public Property AllowFormattingCells As Boolean
Property Value
AllowFormattingColumns
Gets or sets if formatting columns is allowed.
public bool AllowFormattingColumns { get; set; }
Public Property AllowFormattingColumns As Boolean
Property Value
AllowFormattingRows
Gets or sets if formatting rows is allowed.
Property Value
AllowInsertingColumns
Gets or sets if inserting columns is allowed.
public bool AllowInsertingColumns { get; set; }
Public Property AllowInsertingColumns As Boolean
Property Value
AllowInsertingHyperlinks
Gets or sets if inserting hyperlinks is allowed.
public bool AllowInsertingHyperlinks { get; set; }
Public Property AllowInsertingHyperlinks As Boolean
Property Value
AllowInsertingRows
Gets or sets if inserting rows is allowed.
Property Value
AllowSelectingLockedCells
Gets or sets if selecting locked cells is allowed. Default value is true.
public bool AllowSelectingLockedCells { get; set; }
Public Property AllowSelectingLockedCells As Boolean
Property Value
AllowSelectingUnlockedCells
Gets or sets if selecting unlocked cells is allowed. Default value is true.
public bool AllowSelectingUnlockedCells { get; set; }
Public Property AllowSelectingUnlockedCells As Boolean
Property Value
AllowSorting
Gets or sets if sorting is allowed.
Property Value
AllowUsingAutoFilter
Gets or sets if using autofilter is allowed.
public bool AllowUsingAutoFilter { get; set; }
Public Property AllowUsingAutoFilter As Boolean
Property Value
AllowUsingPivotTableReports
Gets or sets if using pivot table reports is allowed.
public bool AllowUsingPivotTableReports { get; set; }
Public Property AllowUsingPivotTableReports As Boolean
Property Value
HasPassword
Gets a value indicating whether the protected sheet has a passoword.
Property Value
PasswordHash
Gets or sets the password hash for protected sheet.
Property Value
Remarks
This property needs to be set to ushort value (property is of type int because ushort is not CLS compliant). For setting a password, the SetPassword(String) method can also be used.
Methods
SetPassword(String)
Sets the password for protected sheet.
Parameters
password
- String
The password.