View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Holmes Bob Holmes is offline
external usenet poster
 
Posts: 13
Default Preventing shortcut keys from working on disabled toolbars

I looked at 'OnKey' and it seems to be a way of specifying keyboard
shortcuts to run a routine. I was hoping that their was a simple way of
telling Excel that if the menu is disabled, then disable all of the
functionality on that menu, e.g. If I disable the 'Edit' command from the
menu (or disable the entire menu bar), I don't want the user to be able to
use 'ctrl-C' to copy. However, if I add the copy feature to a custom menu,
then the shortcut should work.
Regarding my second issue, is there some reason that my code to restore the
original menu and toolbars does not work from the 'BeforeClose' event.
Perhaps this code should be in another event in order to work. If anyone
has any other suggestions, I would be very grateful to hear them. Thank
you.

--
Bob Holmes

"Township of East Hanover" wrote in message
...
Have you looked into Application.Onkey, I think that you have to put it on
the Workbook.Open event.

Rui

"Bob Holmes" wrote in message
...
Hello,
I'm trying to develop a small data entry front-end for a database

using
Excel. I would like to limit the things that the user can do to editing

and
printing. I have been experimenting with creating a custom menu bar and
disabling the existing menu and toolbars. There are two things that I

don't
seem to be able to do.
First - I can disable the menu bar ("Worksheet Menu Bar") and create a

new
menu, but I can't prevent the user from using 'ctrl' keys to perform the
same features that I'm trying to stop by disabling the menu.
Second - I would like to use the Workbook_BeforeClose event to restore

the
menu and toolbars. I wrote a routine to keep track of visible toolbars.

I
can disable them and then run the routine to restore them. If I place

code
in the "BeforeClose" event, the routine runs and all of my variables

show
the correct values, but nothing happens.

Ideally, what I would like is to have this workbook appear as a

stand-alone
application with it's own toolbar and menu with no access to any other
features. And, to not have my customization affect any other workbooks.

I would appreciate it very much if someone could give me a clue about

either
of these problems. Thank you.
I'll be happy to provide my code if would help get a solution.