Syncfusion.XlsIO.ExcelSheetProtection enum

Hello,

I was previously using version 6.3.1.8 of the Syncfusion.XlsIO and the enum ExcelSheetProtection.Default existed. In version 8.2.0.18 this constant does not exist. What can I replace this constant with in version 8.2.0.18 to create a similar permission set?

Thank you.

Nick

1 Reply

LR Lokesh R Syncfusion Team May 7, 2010 06:52 AM UTC

Hi Nick,

Thank you very much for using Syncfusion products.

As you have reported in your post. The equivalent permission set in 8.2.0.18 for the ExcelSheetProtection.DefaultProtect constant available in 6.3.1.8 is
ExcelSheetProtection.LockedCells | ExcelSheetProtection.UnLockedCells. Below, I have also added the code snippet for the same, could you please try the code snippet and let us know if this helps you.

[C#] Code Snippet:

ExcelEngine engine = new ExcelEngine();
IApplication app = engine.Excel;
IWorkbook workBook = app.Workbooks.Create(2);

//Equivalent permission set in 8.2.0.18 for the Defaultprotect option available in 6.3.1.8
workBook.Worksheets[0].Protect("Syncfusion", ExcelSheetProtection.LockedCells | ExcelSheetProtection.UnLockedCells);

workBook.SaveAs("Sample.xls");
workBook.Close();

Please, let us know if you have any queries.

Thanks,
Lokesh.

Loader.
Up arrow icon