Free Support Forum -

Cell protect

When a cell is protected ,others allow to be edited.Please tell me how to realize it ?

You can try 2 approaches:

1. In MS Excel, select all cells in a worksheet, uncheck "Locked" setting in "Format Cells..." window.

Next select a cell which you want to protect it, check "Locked" setting in "Format Cells..." window.

Finally, please protect this whole worksheet.

2. Using following code with Aspose.Cells:

Workbook excel = new Workbook();
Style style = excel.DefaultStyle;
style.IsLocked = false;
excel.DefaultStyle = style;
excel.Worksheets[0].Cells["A1"].Style.IsLocked = true;