Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Disable Menu Items

I am currently using vba to disable menu items, using the
Application.CommandBars syntax, for example:
Application.CommandBars("Edit").Controls(2).Enable d = False
This is having an effect on all of Excel.
Is there a way I can disable it only for the Active Workbook.
I tried this:
ActiveWorkbook.CommandBars("Edit").Controls(2).Ena bled = False
but I am getting an error "obejct variable not set" run time 91
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Disable Menu Items

hi James

See
http://www.rondebruin.nl/menuid.htm

Is there a way I can disable it only for the Active Workbook.


Read also this section
Other useful examples



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"James" wrote in message
...
I am currently using vba to disable menu items, using the
Application.CommandBars syntax, for example:
Application.CommandBars("Edit").Controls(2).Enable d = False
This is having an effect on all of Excel.
Is there a way I can disable it only for the Active Workbook.
I tried this:
ActiveWorkbook.CommandBars("Edit").Controls(2).Ena bled = False
but I am getting an error "obejct variable not set" run time 91
Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Disable Menu Items

Put the disable command [Application.CommandBars("Edit").Controls(2).Enable d
= False] in the "Private Sub Workbook_Activate()" procedure of the
'ThisWorkbook' and the enable command
[Application.CommandBars("Edit").Controls(2).Enable d = True] in the "Private
Sub Workbook_Deactivate()" of the 'ThisWorkbook'.
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"James" wrote:

I am currently using vba to disable menu items, using the
Application.CommandBars syntax, for example:
Application.CommandBars("Edit").Controls(2).Enable d = False
This is having an effect on all of Excel.
Is there a way I can disable it only for the Active Workbook.
I tried this:
ActiveWorkbook.CommandBars("Edit").Controls(2).Ena bled = False
but I am getting an error "obejct variable not set" run time 91
Thanks

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
disable menu items Josh C Excel Programming 5 May 2nd 07 08:49 PM
Enable/Disable Menu Items Andrew Kennard Excel Programming 3 January 25th 05 04:12 PM
Is is possible to disable certain menu items Buster Excel Programming 1 November 19th 04 08:11 AM
Disable menu items with VBA jst_se Excel Programming 1 July 22nd 04 08:25 PM
HELP - How do I disable Excels menu items so others can't use Marcello do Guzman Excel Programming 2 December 20th 03 02:14 PM


All times are GMT +1. The time now is 01:57 AM.

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"