Class WorkbookProtection
Represents the workbook protection class used by the spreadsheet model.
Inherited Members
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class WorkbookProtection
Constructors
WorkbookProtection()
Initializes a new WorkbookProtection for the supplied workbook data.
Declaration
public WorkbookProtection()
Properties
LockRevision
Exposes the lock revision associated with WorkbookProtection.
Declaration
public bool LockRevision { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LockStructure
Exposes the lock structure associated with WorkbookProtection.
Declaration
public bool LockStructure { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LockWindows
Exposes the lock windows associated with WorkbookProtection.
Declaration
public bool LockWindows { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
PasswordHash
Exposes the password hash associated with WorkbookProtection.
Declaration
public ushort PasswordHash { get; set; }
Property Value
| Type | Description |
|---|---|
| ushort |
RevisionPassword
Exposes the revision password associated with WorkbookProtection.
Declaration
public string RevisionPassword { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Protect(string, bool, bool, bool)
Configures workbook protection flags and sets the protection password hash.
Declaration
public void Protect(string password, bool lockStructure = true, bool lockWindows = false, bool lockRevision = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | password | Password used for protection. Null or empty clears the hash. |
| bool | lockStructure | Whether workbook structure should be locked. |
| bool | lockWindows | Whether workbook windows should be locked. |
| bool | lockRevision | Whether revision lock should be enabled. |
SetPasswordHash(string)
Set the password hash from a given password.
Declaration
public void SetPasswordHash(string password)
Parameters
| Type | Name | Description |
|---|---|---|
| string | password | The password to hash |