ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HELP - How do I disable Excels menu items so others can't use (https://www.excelbanter.com/excel-programming/285913-help-how-do-i-disable-excels-menu-items-so-others-cant-use.html)

Marcello do Guzman

HELP - How do I disable Excels menu items so others can't use
 
I was able to figure out how to disable shortcut keys, but I need to
disable the following menu items so that users can't use them while my
Excel application is open.

- MACROS list box
- Visual Basic Editor


I also need to be able to reinstate the above menu items so that they
can used after I close the Excel application.

I hope you can help me with this and provide the code and where
exactly I should place it in the VBE.

Thank you in advance. Please reply via email:



SIncerely,


Marcello

Ron de Bruin

HELP - How do I disable Excels menu items so others can't use
 
Try this

For the Visual Basic Editor use the number 1695
This will work in 97-2003

Sub menuItem_Enabledfalse()
Dim a As Integer
On Error Resume Next
For a = 1 To Application.CommandBars.Count
For Each ctl In CommandBars(a).Controls
Application.CommandBars(a).FindControl(Id:=186, Recursive:=True).Enabled = False
Next ctl
Next a
End Sub

Sub menuItem_Enabledtrue()
Dim a As Integer
On Error Resume Next
For a = 1 To Application.CommandBars.Count
For Each ctl In CommandBars(a).Controls
Application.CommandBars(a).FindControl(Id:=186, Recursive:=True).Enabled = True
Next ctl
Next a
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Marcello do Guzman" wrote in message ...
I was able to figure out how to disable shortcut keys, but I need to
disable the following menu items so that users can't use them while my
Excel application is open.

- MACROS list box
- Visual Basic Editor


I also need to be able to reinstate the above menu items so that they
can used after I close the Excel application.

I hope you can help me with this and provide the code and where
exactly I should place it in the VBE.

Thank you in advance. Please reply via email:



SIncerely,


Marcello




kedarkulkarni[_3_]

HELP - How do I disable Excels menu items so others can't use
 
try using the code in workbook activate deactivate events so for othe
workbooks the menu bar will be available.


ignore this code if you can not switch the windows when the menuar i
hidden ( ctrl+tab )(i dont know if u can swich windows when menubar i
hidden

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:00 AM.

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