PC Review


Reply
Thread Tools Rate Thread

Disable commands for one workbook

 
 
=?Utf-8?B?U3RldmUgQw==?=
Guest
Posts: n/a
 
      5th Mar 2007
I am using the following commands to disable certain options for a specific
workbook. However, if any other workbooks are open, these same options are
also disable for them. How can I disable commands only for a specific
workbook rather than all open workbooks? Thanks.

Application.CommandBars.Item("Data").Controls.Item("Filter").Controls.Item("&Advanced Filter...").Enabled = False
Application.CommandBars.Item("Tools").Controls.Item("&Customize...").Enabled
= False
Application.CommandBars("Toolbar List").Enabled = False


--
Steve C
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      5th Mar 2007
Hi Steve

Read the Information part (3)
http://www.rondebruin.nl/menuid.htm

--

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


"Steve C" <(E-Mail Removed)> wrote in message news:E327109F-4D60-405B-96C9-(E-Mail Removed)...
>I am using the following commands to disable certain options for a specific
> workbook. However, if any other workbooks are open, these same options are
> also disable for them. How can I disable commands only for a specific
> workbook rather than all open workbooks? Thanks.
>
> Application.CommandBars.Item("Data").Controls.Item("Filter").Controls.Item("&Advanced Filter...").Enabled = False
> Application.CommandBars.Item("Tools").Controls.Item("&Customize...").Enabled
> = False
> Application.CommandBars("Toolbar List").Enabled = False
>
>
> --
> Steve C

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      5th Mar 2007
These are application level settings. Therefore you would need to set them
each time a workbook became active. Instantiate application level events in
this workbook and use the WorkbookActivate and WorkbookDeactivate events to
control the settings

http://www.cpearson.com/excel/appevent.htm

--
Regards,
Tom Ogilvy


"Steve C" wrote:

> I am using the following commands to disable certain options for a specific
> workbook. However, if any other workbooks are open, these same options are
> also disable for them. How can I disable commands only for a specific
> workbook rather than all open workbooks? Thanks.
>
> Application.CommandBars.Item("Data").Controls.Item("Filter").Controls.Item("&Advanced Filter...").Enabled = False
> Application.CommandBars.Item("Tools").Controls.Item("&Customize...").Enabled
> = False
> Application.CommandBars("Toolbar List").Enabled = False
>
>
> --
> Steve C

 
Reply With Quote
 
=?Utf-8?B?U3RldmUgQw==?=
Guest
Posts: n/a
 
      5th Mar 2007
Thank you both!
--
Steve C


"Tom Ogilvy" wrote:

> These are application level settings. Therefore you would need to set them
> each time a workbook became active. Instantiate application level events in
> this workbook and use the WorkbookActivate and WorkbookDeactivate events to
> control the settings
>
> http://www.cpearson.com/excel/appevent.htm
>
> --
> Regards,
> Tom Ogilvy
>
>
> "Steve C" wrote:
>
> > I am using the following commands to disable certain options for a specific
> > workbook. However, if any other workbooks are open, these same options are
> > also disable for them. How can I disable commands only for a specific
> > workbook rather than all open workbooks? Thanks.
> >
> > Application.CommandBars.Item("Data").Controls.Item("Filter").Controls.Item("&Advanced Filter...").Enabled = False
> > Application.CommandBars.Item("Tools").Controls.Item("&Customize...").Enabled
> > = False
> > Application.CommandBars("Toolbar List").Enabled = False
> >
> >
> > --
> > Steve C

 
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
Disable commands in menu bar on startup akphidelt Microsoft Access 4 1st Apr 2008 08:53 PM
Disable Keyboard Commands? =?Utf-8?B?YmphbmVMRQ==?= Windows XP General 3 24th Aug 2006 02:03 PM
enable or disable commands =?Utf-8?B?c3M0c2dva3U=?= Windows XP General 1 13th Jul 2006 05:17 AM
how can I disable commands in a word document? =?Utf-8?B?VGF5bw==?= Microsoft Word Document Management 1 5th Aug 2005 10:10 AM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Microsoft Excel Programming 1 24th Jul 2003 11:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:06 PM.