Gets or sets a value that indicates whether the cell is locked. If the cell is not locked it can be modified when the sheet is protected.
[Visual Basic] Property Locked As Boolean [C#] bool Locked { get; set; } [C++] __property bool get_Locked(); __property void set_Locked(bool ); [JScript] function get Locked() : bool function set Locked(bool);
true if the cell is locked, false if the cell can be modified when the sheet is protected. Default value is true.
This example unlocks cells B5:F30 on sheet one so that they can be modified when the sheet is protected.
[C#]
IRange r = book.Worksheets[1].Range["B5:F30"];
r.Locked = false;
book.Worksheets[1].Protect();
[Visual Basic]
Dim r As IRange = book.Worksheets(1).Range("B5:F30")
r.Locked = False
book.Worksheets(1).Protect()
[C++]
IRange* r = book->Worksheets->Item[1]->Range->Item[S"B5:F30"];
r->Locked = false;
book->Worksheets->Protect();
IRange Interface | NativeExcel Namespace