WorksheetProtection Class
Protection settings. Supported in XLSX, XLSB and XLS only.
- Inheritance:
- System.ObjectWorksheetProtection
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
- System.Boolean
AllowDeletingRows
Gets or sets if deleting rows is allowed.
Property Value
- System.Boolean
AllowEditingObjects
Gets or sets if editing objects is allowed.
Property Value
- System.Boolean
AllowEditingScenarios
Gets or sets if editing scenarios is allowed.
public bool AllowEditingScenarios { get; set; }
Public Property AllowEditingScenarios As Boolean
Property Value
- System.Boolean
AllowFormattingCells
Gets or sets if formatting cells is allowed.
public bool AllowFormattingCells { get; set; }
Public Property AllowFormattingCells As Boolean
Property Value
- System.Boolean
AllowFormattingColumns
Gets or sets if formatting columns is allowed.
public bool AllowFormattingColumns { get; set; }
Public Property AllowFormattingColumns As Boolean
Property Value
- System.Boolean
AllowFormattingRows
Gets or sets if formatting rows is allowed.
Property Value
- System.Boolean
AllowInsertingColumns
Gets or sets if inserting columns is allowed.
public bool AllowInsertingColumns { get; set; }
Public Property AllowInsertingColumns As Boolean
Property Value
- System.Boolean
AllowInsertingHyperlinks
Gets or sets if inserting hyperlinks is allowed.
public bool AllowInsertingHyperlinks { get; set; }
Public Property AllowInsertingHyperlinks As Boolean
Property Value
- System.Boolean
AllowInsertingRows
Gets or sets if inserting rows is allowed.
Property Value
- System.Boolean
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
- System.Boolean
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
- System.Boolean
AllowSorting
Gets or sets if sorting is allowed.
Property Value
- System.Boolean
AllowUsingAutoFilter
Gets or sets if using autofilter is allowed.
public bool AllowUsingAutoFilter { get; set; }
Public Property AllowUsingAutoFilter As Boolean
Property Value
- System.Boolean
AllowUsingPivotTableReports
Gets or sets if using pivot table reports is allowed.
public bool AllowUsingPivotTableReports { get; set; }
Public Property AllowUsingPivotTableReports As Boolean
Property Value
- System.Boolean
HasPassword
Gets a value indicating whether the protected sheet has a password.
Property Value
- System.Boolean
PasswordHash
Gets or sets the password hash for protected sheet.
Property Value
- System.Int32
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
- System.String
The password.