Table of Contents

Class ExcelWriteProtection

Namespace
OfficeOpenXml
Assembly
EPPlus.dll

File sharing settings for the workbook.

public class ExcelWriteProtection : XmlHelper
Inheritance
ExcelWriteProtection
Inherited Members

Properties

IsReadOnly

If the workbook is set to readonly and has a password set.

public bool IsReadOnly { get; }

Property Value

bool

ReadOnlyRecommended

If the author recommends that you open the workbook in read-only mode.

public bool ReadOnlyRecommended { get; set; }

Property Value

bool

UserName

The name of the person enforcing the write protection.

public string UserName { get; set; }

Property Value

string

Methods

RemoveReadOnly()

Remove any write protection set on the workbook

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.

public void SetReadOnly(string userName, string password)

Parameters

userName string

The name of the person enforcing the write protection

password string

The password. Setting the password to null or empty will remove the read-only mode.