How to disable Keyboard shortcut

  • Thread starter Thread starter JON-JON
  • Start date Start date
J

JON-JON

Hello VB Experts,

I am the same person that recently post a problem about BeforePrint Event. I
get away with that problem. What I did is to put this code to my open
event.

For Each bar In Application.CommandBars
bar.Enabled = False
Next bar

My problem now is how to disable keyboard shortcut (e.g. ctrl+o) so that
what will be left for my user is my macro that I plan to assign to an
embedded object.

BTW - Thanks to those who care to help sp. William and Tom

Thanks again in advance!

Jon-jon
 
Just redefine the key with the OnKey method. You can either assign those
shortcuts to your macro or disable them. See the help in VBA on the OnKey
method for the details of the arguments to OnKey (2nd argument) and the
effect of each type of argument (marco, null string, no argument).
 
Hi Jon-jon,
I just realized I answered this thread before, but you were also asking
about the right-click menu (PLY).

Doesn't seem like the kind of thing to endear you with others that
work with Excel. I wouldn't want *anyone* messing with MY toolbars.

You can create your own macro that does nothing and assign keyboard
shortcut of Ctrl+o to it. I don't know how quickly you or anyone else
will find the macro with that shortcut, should it present problems later on.
Been looking for that for awhile.

If you search the Excel newsgroups
http://groups.google.com/advanced_group_search?q=group:*Excel*&num=100
search all words: ply menu group:*Excel*

As you may notice a good deal of the postings were complaints
about Right-Click not working.

Tom Ogilvy posted several links concerning the PLY menu
http://google.com/groups?threadm=uxOVxrUKAHA.247@cppssbbsa04
 
Sorry got that mixed up the right click menu is the Cell command bar
not the Ply Command Bar which is for the worksheet tabs, and you didn't
ask for either one, probably got it mixed up with Lori's question in another
newsgroup. You already answered your own question and so did others.
 
Of course after my codes served it purpose, I will reverse all changes that
I done through the code also. Unless, i want to get fired.

Thanks,

Jon-jon
 
Back
Top