I'm trying to lock specific cells from editing (not the entire sheet).
sheet.Range["A1"].Style.Locked = true;
sheet.Protect("123", SheetProtectionType.All);
the above doesn't work, it locks the entire sheet out and no cell can be edited. When the protection is removed, all cells are editable.
I also tried:
sheet.Protect("123", SheetProtectionType.LockedCells);
Still doesn't work.
I'm just trying to set a column (or cell) to read-only.