NativeExcel2 for .Net Developer's Reference

IWorksheet.ProtectMethod()

Protects a worksheet without using a password.

[Visual Basic]
SubProtect()
[C#]
voidProtect();
[C++]
voidProtect();
[JScript]
functionProtect();

Example

This example protects worksheet one.

[C#]
book.Worksheets[1].Protect(); 
[VisualBasic]
book.Worksheets(1).Protect() 
[C++]
book->Worksheets->Item[1]->Protect();

See Also

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