Hello,
I created an Excel file with the following code:
Workbook exportWorkbook = new Workbook();
Worksheet exportWorksheet=exportWorkbook.Worksheets.Add("Export");
I filled some cells, and tried to protect the cells on the first row with the following code:
exportWorksheet.Rows[0].CellFormat.Locked = ExcelDefaultableBoolean.True; exportWorksheet.Protected = true;exportWorkbook.Protected = true; exportWorkbook.Save(@"C:\Export\testexport.xls");
exportWorksheet.Protected = true;
exportWorkbook.Save(@"C:\Export\testexport.xls");
But when I open the file in Excel the cells are not protected. Did I miss some settings? Can anyone help me?
Thanks in advance.
Jennifer
I tried your code and it worked for me. Try downloading the latest hotfix for the version you are using. It's possible a bug was fixed which addresses this issue. If you still have the problem with the latest hotfix, I would recommend submitting the issue to the support group: http://es.infragistics.com/gethelp.