NativeExcel for .Net Developer's Reference

IWorksheet.Unprotect Method

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

Overload List

Removes protection from a sheet without using a password.

[Visual Basic] Sub Unprotect()
[C#] void Unprotect();
[C++] void Unprotect();
[JScript] function Unprotect();

Removes protection from a worksheet with using a password.

[Visual Basic] Sub Unprotect(ByVal String)
[C#] void Unprotect(string);
[C++] void Unprotect(String*);
[JScript] function Unprotect(String);

Example

This example removes protection from the worksheet one.

[C#]
book.Worksheets[1].Unprotect("Pass1234"); 
[Visual Basic]
book.Worksheets(1).Unprotect("Pass1234")
[C++]
book->Worksheets->Item[1]->Unprotect(S"Pass1234");

See Also

IWorksheet Interface | NativeExcel Namespace | Protect Method