NativeExcel2 for .Net Developer's Reference

IWorksheet.Protection Property

Returns an IProtection interface that represents the various types of protection options available for a worksheet.

[Visual Basic]
PropertyReadOnlyProtectionAsIProtection
[C#]
IProtectionProtection{get;}
[C++]
__propertyIProtection*get_Protection();
[JScript]
functiongetProtection():IProtection

Property Value

IProtection interface.

Example

This example changes the protection options for sheet one

[C#]
book.Worksheets[1].Protection.AllowDeletingColumns = true;
[VisualBasic]
book.Worksheets(i).Protection.AllowDeletingColumns = True
[C++]
book->Worksheets->Item[i]->Protection->AllowDeletingColumns = true;

See Also

IWorksheet Interface | NativeExcel Namespace