ASP.NET - lock excel sheet cells from editing - Asked By SVK N on 16-Jun-13 06:14 PM

in my web application i need to export data to excel from datatable in a particular format

this has been done.  i need to lock some cells range to prevent editing in excel sheet

i tried but it does not get locked


ExcApp = New Excel.Application

ExcWS = ExcApp.Worksheets("SHEET1")

ExcWS.Range("A1", "C3").Locked = True

ExcWS.Protect(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)


2) i need to display checkbox against each supplier no displayed in the sheet & when few of the suppliers are checked , need to import the checked data in thedatabase  i dont want to protect the entire sheet as few cells will be editable