Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Command Bar Excel 2007

I can delete custom menu items that I create in VB by using:

Application.Commandbars(1).Controls("TheControl"). Delete

However, in this file there is now a menubar (I don't know how it is being
added as I am not doing it in code) called "Print All Sheets".

I have tried to reference it by name as
Application.CommandBars.Controls("Print All Sheets".Delete but get nothing
(although this works perfect on the others that I add in VB").

I can delete it by right clicking on it and selecting "Delete Custom
Command", however it reloads itself (before my VB menu Add Ins are accessed)
when the file is reopened.

Any ideas are much appreciated.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Command Bar Excel 2007

Deleting the toolbar or menubar removes it from the UI for the current
session but not from the workbook it is attached to or created by. You have
to remove it from there. If it's an attached toolbar (I know you said
menubar) there is no way to detach, as far as I know, in Excel 2007. You'd
have to do that in Excel 97-2003. If a macro is creating the menubar you'd
have to find the code and delete it.

--
Jim
"Troubled User" wrote in message
...
|I can delete custom menu items that I create in VB by using:
|
| Application.Commandbars(1).Controls("TheControl"). Delete
|
| However, in this file there is now a menubar (I don't know how it is being
| added as I am not doing it in code) called "Print All Sheets".
|
| I have tried to reference it by name as
| Application.CommandBars.Controls("Print All Sheets".Delete but get nothing
| (although this works perfect on the others that I add in VB").
|
| I can delete it by right clicking on it and selecting "Delete Custom
| Command", however it reloads itself (before my VB menu Add Ins are
accessed)
| when the file is reopened.
|
| Any ideas are much appreciated.
|
|
|

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Command Bar Excel 2007

Thanks Jim. I have looked for the code (searching VB for "Print All Sheets")
and I get nothing. I can remove it during the session by right clicking and
selecting the "Delete Custom Command"). Seeing as I can't find where it is
coming from I just want to automated this delete process. Thanks.



"Jim Rech" wrote:

Deleting the toolbar or menubar removes it from the UI for the current
session but not from the workbook it is attached to or created by. You have
to remove it from there. If it's an attached toolbar (I know you said
menubar) there is no way to detach, as far as I know, in Excel 2007. You'd
have to do that in Excel 97-2003. If a macro is creating the menubar you'd
have to find the code and delete it.

--
Jim
"Troubled User" wrote in message
...
|I can delete custom menu items that I create in VB by using:
|
| Application.Commandbars(1).Controls("TheControl"). Delete
|
| However, in this file there is now a menubar (I don't know how it is being
| added as I am not doing it in code) called "Print All Sheets".
|
| I have tried to reference it by name as
| Application.CommandBars.Controls("Print All Sheets".Delete but get nothing
| (although this works perfect on the others that I add in VB").
|
| I can delete it by right clicking on it and selecting "Delete Custom
| Command", however it reloads itself (before my VB menu Add Ins are
accessed)
| when the file is reopened.
|
| Any ideas are much appreciated.
|
|
|


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Command Bar Excel 2007

Seeing as I can't find where it is coming from I just want to automated
this delete process.


If you send me the file I'll try to figure it out. Always like a
mystery.<g

--
Jim
"Troubled User" wrote in message
...
| Thanks Jim. I have looked for the code (searching VB for "Print All
Sheets")
| and I get nothing. I can remove it during the session by right clicking
and
| selecting the "Delete Custom Command"). Seeing as I can't find where it
is
| coming from I just want to automated this delete process. Thanks.
|
|
|
| "Jim Rech" wrote:
|
| Deleting the toolbar or menubar removes it from the UI for the current
| session but not from the workbook it is attached to or created by. You
have
| to remove it from there. If it's an attached toolbar (I know you said
| menubar) there is no way to detach, as far as I know, in Excel 2007.
You'd
| have to do that in Excel 97-2003. If a macro is creating the menubar
you'd
| have to find the code and delete it.
|
| --
| Jim
| "Troubled User" wrote in
message
| ...
| |I can delete custom menu items that I create in VB by using:
| |
| | Application.Commandbars(1).Controls("TheControl"). Delete
| |
| | However, in this file there is now a menubar (I don't know how it is
being
| | added as I am not doing it in code) called "Print All Sheets".
| |
| | I have tried to reference it by name as
| | Application.CommandBars.Controls("Print All Sheets".Delete but get
nothing
| | (although this works perfect on the others that I add in VB").
| |
| | I can delete it by right clicking on it and selecting "Delete Custom
| | Command", however it reloads itself (before my VB menu Add Ins are
| accessed)
| | when the file is reopened.
| |
| | Any ideas are much appreciated.
| |
| |
| |
|
|

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Command Bar Excel 2007

Thanks Jim. Ended up being a Menu control that was added sometime in 2001.
It did not display in Excel 2003, but was still in the file and would display
in the Command control (although inoperable and unable to remove in code). I
saved the 2003 file as a 2007 file and it removed it. I then saved the 2007
file back as a 2003 file and everything seems to be fine.

Thanks for your efforts!



"Troubled User" wrote:

I can delete custom menu items that I create in VB by using:

Application.Commandbars(1).Controls("TheControl"). Delete

However, in this file there is now a menubar (I don't know how it is being
added as I am not doing it in code) called "Print All Sheets".

I have tried to reference it by name as
Application.CommandBars.Controls("Print All Sheets".Delete but get nothing
(although this works perfect on the others that I add in VB").

I can delete it by right clicking on it and selecting "Delete Custom
Command", however it reloads itself (before my VB menu Add Ins are accessed)
when the file is reopened.

Any ideas are much appreciated.



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
Where is the undo command in Excel 2007? kedawy Excel Discussion (Misc queries) 3 April 9th 09 04:46 PM
Command Button Excel 2007 dhstein Excel Discussion (Misc queries) 4 February 15th 09 04:14 PM
Disable command bar Excel 2007 and Vista Josh C Excel Programming 17 November 11th 08 03:59 PM
How can I edit command bar icons in Excel 2007? Marley the Cat Setting up and Configuration of Excel 1 August 23rd 08 11:35 AM
Size with Window Command in Excel 2007 Bill[_30_] Excel Programming 5 December 4th 06 06:08 PM


All times are GMT +1. The time now is 04:09 AM.

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

About Us

"It's about Microsoft Excel"