Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Disable commands for one workbook

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.Ite m("&Customize...").Enabled
= False
Application.CommandBars("Toolbar List").Enabled = False


--
Steve C
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Disable commands for one workbook

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" wrote in message ...
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.Ite m("&Customize...").Enabled
= False
Application.CommandBars("Toolbar List").Enabled = False


--
Steve C

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Disable commands for one workbook

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.Ite m("&Customize...").Enabled
= False
Application.CommandBars("Toolbar List").Enabled = False


--
Steve C

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Disable commands for one workbook

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.Ite m("&Customize...").Enabled
= False
Application.CommandBars("Toolbar List").Enabled = False


--
Steve C

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 Pasting into a Workbook scottyboy Excel Worksheet Functions 2 May 9th 08 12:21 PM
Shared workbook and Macro commands Danie Excel Discussion (Misc queries) 4 May 21st 07 03:16 PM
Disable cut paste in a workbook Narendra Nath Excel Programming 0 March 10th 06 01:42 PM
Disable the opening of another workbook DDLY Excel Programming 1 November 26th 03 07:52 PM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Excel Programming 1 July 24th 03 11:37 PM


All times are GMT +1. The time now is 05:04 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"