Class ExcelWriteProtection
File sharing settings for the workbook.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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 |
---|---|
System.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 |
---|---|
System.Boolean |
UserName
The name of the person enforcing the write protection.
Declaration
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|---|
System.String | userName | The name of the person enforcing the write protection |
System.String | password | The password. Setting the password to null or empty will remove the read-only mode. |