Hi again Chris -
To solve the problem immediately:
If you used the following to turn off the shortcut menu, type the following
into the VBA Immediate Window (and press Enter to run it):
CommandBars("Cell").Enabled = True
If you used the oCtl.Delete approach to turn off the shortcut menu, type the
following into the VBA Immediate Window (and press Enter to run it):
CommandBars("Cell").Reset
----------------------------------------------
Insert either of these lines (as appropriate) at a strategic location in
your VBA code, such as in the Workbook_Close module (or sooner), so that the
menus will be re-enabled as soon as you're done with your application.
--
Jay
--
Jay
"Chris Hankin" wrote:
Please help with unexpected side-effect after running the following
codes:
Dim oCtrl As Object
With Application.CommandBars("Cell")
'Clear the existing menus
For Each oCtrl In .Controls
oCtrl.Delete
Next oCtrl
End With
and
CommandBars("Cell").Enabled = False
When I right-click on any cell in my worksheet, I am unable to bring up
a command pop-up menu. What I get is a small blue-coloured rectangle
instead of a command pop-up menu. I then press the Esc - key to remove
the blue-coloured rectangle.
I also tried the following code to try to set my command menus back to
normal:
CommandBars("Cell").Enabled = True
However, this seems to have no affect and I still keep getting the same
blue-coloured rectangles.
I even tried right-clicking on a new worksheet and the same
blue-coloured rectangle keep appearing.
Could some please advise on how I can reverse this situation?
Kind regards,
Chris.
*** Sent via Developersdex http://www.developersdex.com ***