Click or drag to resize

XlsWorkbook Protect Method (Boolean, Boolean, String)

Protects the workbook based on the provided parameters.

Namespace: Spire.Xls.Core.Spreadsheet
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public void Protect(
	bool bIsProtectWindow,
	bool bIsProtectContent,
	string password
)

Parameters

bIsProtectWindow
Type: System Boolean
Indicates whether to protect the window.
bIsProtectContent
Type: System Boolean
Indicates whether to protect the content.
password
Type: System String
The password to use for protection.
Exceptions
Exception Condition
ArgumentOutOfRangeException Thrown when both bIsProtectWindow and bIsProtectContent are false.
NotSupportedException Thrown when the workbook is already protected.
See Also