ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Turn off menu options with vba (https://www.excelbanter.com/excel-programming/306496-turn-off-menu-options-vba.html)

nath

Turn off menu options with vba
 
Hi

Can anyone advise me if it is possible and also how to do
it if it is, to turn off menu options with VBA code. I
ask this as i have disable the VB toolbar on a sheet to
protect my code, but it can still be accessed via menu
options. I dont really want to password protect the code
as other people may need to use it as and when, but these
people will know how to get the code options back.

Can anyone help

Nath.

leah

Turn off menu options with vba
 
You can turn them off by disabling them like so:

CommandBars(1).Controls("Tools").Controls("&Option s").Enabled = False

The ampersand is for the shortcut key - it seems to be pretty picky
about having that in there.

Hope that helps!
Leah

"nath" wrote in message ...
Hi

Can anyone advise me if it is possible and also how to do
it if it is, to turn off menu options with VBA code. I
ask this as i have disable the VB toolbar on a sheet to
protect my code, but it can still be accessed via menu
options. I dont really want to password protect the code
as other people may need to use it as and when, but these
people will know how to get the code options back.

Can anyone help

Nath.



All times are GMT +1. The time now is 11:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com