The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi , I''m trying to protect the sheets afetr sending the data to sheets but still any user can edit the sheet and it didn''t protect it , here is the code:
SheetAll.Range["A10"].Formula = "SUM(B10:J10)";
SheetAll.Range["A12"].Formula = "SUM(B12:J12)";
SheetAll.Range["A14"].Formula = "SUM(B14:J14)";
SheetAll.Range["A16"].Formula = "SUM(B16:J16)+A14";
SheetAll.Range["A18"].Formula="SUM(B18:J18)+A16";
excelEngine.ThrowNotSavedOnDestroy = false;
SheetAll.Range["A1:M26"].Text="Read Only";
SheetSearch.Range[1,1,CountSet,9].Text="Read Only";
SheetInfo.Range["A1:K23"].Text="Read Only";
SheetAll.Protect("syncfusion");
SheetSearch.Protect("syncfusion");
SheetInfo.Protect("syncfusion");
excelEngine.Dispose();
//Launching the Excel file using the default Application.[MS Excel Or Free ExcelViewer]
System.Diagnostics.Process.Start(Application.StartupPath + @"\\repDepInfo.xls");
thanks
ADAdministrator Syncfusion Team April 19, 2005 06:34 PM UTC
Hi Mohammad,
I am just pasting a copy of my Direc-Trac response for other developers who read this thread
I took a look at PrintData and noticed that you were applying protect worksheet only after saving the spreadsheet to disk. Please try to set protection before you save the spreadsheet to disk.
Thanks,
Stephen.
>Hi , I''m trying to protect the sheets afetr sending the data to sheets but still any user can edit the sheet and it didn''t protect it , here is the code:
>SheetAll.Range["A10"].Formula = "SUM(B10:J10)";
> SheetAll.Range["A12"].Formula = "SUM(B12:J12)";
> SheetAll.Range["A14"].Formula = "SUM(B14:J14)";
> SheetAll.Range["A16"].Formula = "SUM(B16:J16)+A14";
> SheetAll.Range["A18"].Formula="SUM(B18:J18)+A16";
> excelEngine.ThrowNotSavedOnDestroy = false;
> SheetAll.Range["A1:M26"].Text="Read Only";
> SheetSearch.Range[1,1,CountSet,9].Text="Read Only";
> SheetInfo.Range["A1:K23"].Text="Read Only";
> SheetAll.Protect("syncfusion");
> SheetSearch.Protect("syncfusion");
> SheetInfo.Protect("syncfusion");
> excelEngine.Dispose();
> //Launching the Excel file using the default Application.[MS Excel Or Free ExcelViewer]
> System.Diagnostics.Process.Start(Application.StartupPath + @"\\repDepInfo.xls");
>
>thanks