I'm using Excel 2007 on Win7.
I'd like to run some code if the user double clicks in certain cells. However, I don't want the double click to make Excel go into Edit mode. (It's annoying and interferes with the code that runs.)
Yesterday, I was able to do this by adding the line "Cancel = True" to my VBA.
Today, Excel doesn't seem to recognize the Cancel command. I've replicated this by opening a new workbook and adding the following code to Sheet1:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
This does not prevent Excel from going into edit mode. Does anyone have a solution? Can others replicate the issue?
I assume that some setting/option has changed in my copy of Excel or that Microsoft released a patch, I just have no idea what it could be.
Thanks
Rob
I'd like to run some code if the user double clicks in certain cells. However, I don't want the double click to make Excel go into Edit mode. (It's annoying and interferes with the code that runs.)
Yesterday, I was able to do this by adding the line "Cancel = True" to my VBA.
Today, Excel doesn't seem to recognize the Cancel command. I've replicated this by opening a new workbook and adding the following code to Sheet1:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
This does not prevent Excel from going into edit mode. Does anyone have a solution? Can others replicate the issue?
I assume that some setting/option has changed in my copy of Excel or that Microsoft released a patch, I just have no idea what it could be.
Thanks
Rob