Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Locking cell in worksheet
posted
I've created the excel worksheet and saved it. What I need to do it lock certain cells in the worksheet. my code to lock the cells is: For col As Integer = 0 To mPrimaryKeyColumn.Length - 1 For Each row As WorksheetRow In theWorkSheet.Rows row.Cells(col).CellFormat.Locked = ExcelDefaultableBoolean.True Next Next theWorkSheet.Protected = True The problem is, is that "theWorkSheet.Protected = True" locks the whole worksheet. I have tried to set every single cell to "row.Cells(col).CellFormat.Locked = ExcelDefaultableBoolean.False" before protecting the worksheet, but with no success. In excel (2007), in the "Protect Sheet" options, there is a whole list of permission that you can allow users to do to locked worksheets. I need to allow the users to edit cells that are not locked. How? Please help.