NativeExcel for .Net Developer's Reference

IWorkbook.UnprotectMethod(String)

Removes protection from a workbook using password. This method has no effect if the workbook isn't protected.

[Visual Basic]
SubUnprotect(_
ByValPasswordAsString_
)
[C#]
voidUnprotect(
stringPassword
);
[C++]
voidUnprotect(
String*Password
);
[JScript]
functionUnprotect(
StringPassword
);

Parameters

Password
A string that denotes the case-sensitive password to use to unprotect the workbook. If the workbook isn't protected with a password, this argument is ignored.

Example

This example removes protection from the workbook.

[C#]
book.Unprotect("MyPass123"); 
[VisualBasic]
book.Unprotect("MyPass123")
[C++]
book->Unprotect(S"MyPass123");

See Also

IWorkbook Interface | NativeExcel Namespace | IWorkbook.Unprotect Overload List