Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Edit Excels Help Menu? sm0003 Excel Discussion (Misc queries) 0 February 23rd 10 04:46 PM
How disable menu command Armangelo Excel Discussion (Misc queries) 0 February 1st 06 10:00 AM
Disable Items in Menubar cassy01 Excel Discussion (Misc queries) 2 November 8th 05 08:20 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
Disable menu selection andy Excel Discussion (Misc queries) 3 December 10th 04 10:46 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"