in Execl is it possible to lock/protect the options

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Microsoft Excel is it possible to password protect the options to stop
them being adjusted in a protected worksheet
 
Mark

If you insert the following VBA line into your project then the 'Options'
menu will not be available:

commandbars("Worksheet Menu
Bar").Controls("Tools").Controls("Options").Enabled=False

If you put this in the OpenWorkbook Event, then as soon as your workbook is
opened the code will run and the options menu will be disabled.
It is of course good practice to also put a similar line into your
CloseWorkbook event code, but change the 'False' statement to true, so that
the option is again available.

If you wish to disable the whole of a particular menu tree, youe could
truncate the line, so to diable the entire 'Tools' menu tree the line would
be:

commandbars("Worksheet Menu Bar").Controls("Tools").Enabled=False

Note - the above code samples are on one continuous line, not two as
displayed on screen.

HTH


Neil
www.nwarwick.co.uk
 
Neil,
Maybe I'm not entering it correctly in VB...not sure but cannot get it to
work. Can you please expand on the instructions on where to place the line.

Thanks...Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top