mdobs
08-01-2001, 04:44 PM
Do you know how to turn off the dialog box that pops up when I try to modify a cell in a protected workbook.
Specifically:
I use some vba to protect and unprotect certain sheets in my workbook based on certain events. When a cell is double clicked my program
1)unprotects the worksheet
2)changes some cell contents based on the contents of the cell that was double clicked
3)turns protection back on
But when you double click a cell in a protected sheet this dialog box comes and it gets annoying. I tried
application.displayalerts = false but to no avail. Any clues???
example code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
Unprotect
If ActiveCell = "yes" Then
Cells(1, 1) = "yes"
Else
Cells(1, 1) = "no"
End If
Protect
End Sub
Thanks
Specifically:
I use some vba to protect and unprotect certain sheets in my workbook based on certain events. When a cell is double clicked my program
1)unprotects the worksheet
2)changes some cell contents based on the contents of the cell that was double clicked
3)turns protection back on
But when you double click a cell in a protected sheet this dialog box comes and it gets annoying. I tried
application.displayalerts = false but to no avail. Any clues???
example code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
Unprotect
If ActiveCell = "yes" Then
Cells(1, 1) = "yes"
Else
Cells(1, 1) = "no"
End If
Protect
End Sub
Thanks