NativeExcel2 for .Net Developer's Reference

IWorksheet.UnprotectMethod(String)

Removes protection from a worksheet with using a password.

[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 worksheet. If the worksheet isn't protected with a password, this argument is ignored.

Example

This example removes protection from a worksheet one with using a password.

[C#]
book.Worksheets[1].Unrotect("Pass1234"); 
[VisualBasic]
book.Worksheets(1).Unrotect("Pass1234")
[C++]
book->Worksheets->Item[1]->Unrotect(S"Pass1234");

See Also

IWorksheet Interface | NativeExcel Namespace | IWorksheet.Unprotect Overload List | Protect Method