WriteProtection Class
Write protection settings. Supported in XLSX only.
- Inheritance:
- System.ObjectWriteProtection
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 write protection, consult Microsoft Excel documentation.
Properties
Author
Gets and sets the author.
Property Value
- System.String
HasPassword
Gets a value indicating whether the workbook has write protection password.
Property Value
- System.Boolean
PasswordHash
Gets or sets the password hash.
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 password, a SetPassword(String) method can also be used.
ReadOnlyRecommended
Gets or sets option that specifies if applications should provide user interface recommending that the user open this spreadsheet in write protected state.
Property Value
- System.Boolean
true if applications should provide user interface recommending that the user open this spreadsheet in write protected state; otherwise, false.
Methods
SetPassword(String)
Sets the password for write protection.
Parameters
password
- System.String
The password.