We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Protecteng Cell Sheet

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

1 Reply

AD Administrator 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

Loader.
Live Chat Icon For mobile
Up arrow icon