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
)
Public Sub Protect (
bIsProtectWindow As Boolean,
bIsProtectContent As Boolean,
password As String
)
public:
void Protect(
bool bIsProtectWindow,
bool bIsProtectContent,
String^ password
)
member Protect :
bIsProtectWindow : bool *
bIsProtectContent : bool *
password : string -> unit
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