PC Review


Reply
Thread Tools Rate Thread

Disabling Built-in items on a menu

 
 
Project Mangler
Guest
Posts: n/a
 
      20th May 2010
The following code disables the File menu on the Worksheet Menubar

CommandBars(1).Controls("File").Enabled = True

Ideally I'd like to be able to disable an individual item on the menu e.g.
"Print", but I've struggled to get there.

Can someone please explain how this is achieved?

Thanks.


 
Reply With Quote
 
 
 
 
Project Mangler
Guest
Posts: n/a
 
      20th May 2010
Got it thanks:

With Application.CommandBars(1).Controls("File")
..Controls("Print...").Enabled = False
End With



"Project Mangler" <(E-Mail Removed)> wrote in message
news:%23buHBDG%(E-Mail Removed)...
> The following code disables the File menu on the Worksheet Menubar
>
> CommandBars(1).Controls("File").Enabled = True
>
> Ideally I'd like to be able to disable an individual item on the menu e.g.
> "Print", but I've struggled to get there.
>
> Can someone please explain how this is achieved?
>
> Thanks.
>
>



 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      21st May 2010
Better to use the ID
http://www.rondebruin.nl/menuid.htm

--

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



"Project Mangler" <(E-Mail Removed)> wrote in message news:uxbTmQG#(E-Mail Removed)...
> Got it thanks:
>
> With Application.CommandBars(1).Controls("File")
> .Controls("Print...").Enabled = False
> End With
>
>
>
> "Project Mangler" <(E-Mail Removed)> wrote in message
> news:%23buHBDG%(E-Mail Removed)...
>> The following code disables the File menu on the Worksheet Menubar
>>
>> CommandBars(1).Controls("File").Enabled = True
>>
>> Ideally I'd like to be able to disable an individual item on the menu e.g.
>> "Print", but I've struggled to get there.
>>
>> Can someone please explain how this is achieved?
>>
>> Thanks.
>>
>>

>
>

 
Reply With Quote
 
Project Mangler
Guest
Posts: n/a
 
      21st May 2010
Ron,

I should have thought of checking your site.

For some reason my code works fine at home (on Win2K/Excel 2003) but not in
my work environment (XP/Excel2003) if run in an activate or startup event.
Oddly it works in XP if I run the procedure directly using F5. Perhaps
switching to the ID will fix it.

Thanks for the reply!


"Ron de Bruin" <(E-Mail Removed)> wrote in message
news:OB%23GuKS%(E-Mail Removed)...
> Better to use the ID
> http://www.rondebruin.nl/menuid.htm
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
>
> "Project Mangler" <(E-Mail Removed)> wrote in message

news:uxbTmQG#(E-Mail Removed)...
> > Got it thanks:
> >
> > With Application.CommandBars(1).Controls("File")
> > .Controls("Print...").Enabled = False
> > End With
> >
> >
> >
> > "Project Mangler" <(E-Mail Removed)> wrote in message
> > news:%23buHBDG%(E-Mail Removed)...
> >> The following code disables the File menu on the Worksheet Menubar
> >>
> >> CommandBars(1).Controls("File").Enabled = True
> >>
> >> Ideally I'd like to be able to disable an individual item on the menu

e.g.
> >> "Print", but I've struggled to get there.
> >>
> >> Can someone please explain how this is achieved?
> >>
> >> Thanks.
> >>
> >>

> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling Menu Items =?Utf-8?B?TmVpbA==?= Microsoft Outlook Installation 0 27th Jun 2007 08:30 PM
Disabling items in a menu =?Utf-8?B?Q2hhcmxpZScncyBXb3JkIFZCQSBxdWVzdGlvbnM= Microsoft Word Document Management 2 29th Mar 2006 08:33 AM
Disabling menu items? Andy Microsoft Access VBA Modules 1 30th Dec 2003 01:14 PM
Remove custom items from built in menu Philip Reece-Heal Microsoft Excel Misc 5 15th Nov 2003 05:17 PM
Re: Disabling menu items Ryan M. Keith [MSFT] Microsoft Outlook Installation 0 15th Jul 2003 05:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:08 AM.