Class ExcelWriteProtection
File sharing settings for the workbook.
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelWriteProtection : XmlHelper
Properties
IsReadOnly
If the workbook is set to readonly and has a password set.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
ReadOnlyRecommended
If the author recommends that you open the workbook in read-only mode.
Declaration
public bool ReadOnlyRecommended { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
UserName
The name of the person enforcing the write protection.
Declaration
public string UserName { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
RemoveReadOnly()
Remove any write protection set on the workbook
Declaration
public void RemoveReadOnly()
SetReadOnly(String, String)
Writes protectes the workbook with a password. EPPlus uses SHA-512 as hash algorithm with a spin count of 100000.
Declaration
public void SetReadOnly(string userName, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| String | userName | The name of the person enforcing the write protection |
| String | password | The password. Setting the password to null or empty will remove the read-only mode. |