PC Review


Reply
Thread Tools Rate Thread

Cannot remove custom commands from 2007 add-ins tab

 
 
George Burdell
Guest
Posts: n/a
 
      9th Mar 2007
Greetings. we have code that worked fine in 2003 to add menu items to the
Tools menu and then remove them when Excel closed. Now in 2007, the code
adds the menu items to the Add-ins tab as a "custom command". And the code
that removed the additions from the Tools menu does not remove the additions
to the Add-ins tab. The code is looking for additions to the Tools menu,
which obviously didn't happen.

I can find no reference to a custom commands collection and thus can find no
way to remove the additions to the Add-ins tab. Even worse, the additions to
the Add-ins tab increases each time the workbooks are opened. As we have
quite a few workbooks that add menu items to the Tools menu, the Add-in tab
is getting cluttered.

We have found that deleting the XLB file at least resets the Add-in tab. It
also is not a satisfactory solution for obvious reasons.

So, how does one use code to remove the custom commands that Excel puts
under the Add-in tab?

Help!

George


 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      9th Mar 2007
I find this code works as expected to add a command to the add-ins tab and
remove it.

Sub AddToTools()
With CommandBars("Tools").Controls.Add(msoControlButton)
.Caption = "My Command"
End With
End Sub

Sub RemoveFromTools()
CommandBars("Tools").Controls("My Command").Delete
End Sub

Can you post code (slimmed down to its essentails) that shows the problem?

--
Jim
"George Burdell" <(E-Mail Removed)> wrote in message
news:rOednamQBq-(E-Mail Removed)...
> Greetings. we have code that worked fine in 2003 to add menu items to the
> Tools menu and then remove them when Excel closed. Now in 2007, the code
> adds the menu items to the Add-ins tab as a "custom command". And the
> code that removed the additions from the Tools menu does not remove the
> additions to the Add-ins tab. The code is looking for additions to the
> Tools menu, which obviously didn't happen.
>
> I can find no reference to a custom commands collection and thus can find
> no way to remove the additions to the Add-ins tab. Even worse, the
> additions to the Add-ins tab increases each time the workbooks are opened.
> As we have quite a few workbooks that add menu items to the Tools menu,
> the Add-in tab is getting cluttered.
>
> We have found that deleting the XLB file at least resets the Add-in tab.
> It also is not a satisfactory solution for obvious reasons.
>
> So, how does one use code to remove the custom commands that Excel puts
> under the Add-in tab?
>
> Help!
>
> George
>



 
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
Excel 2007 Ribbon - Remove unwanted custom toolbars Muscoby Microsoft Excel Discussion 2 9th Mar 2010 04:45 PM
RE: WPF: Need help creating and using custom commands Zhi-Xin Ye [MSFT] Microsoft C# .NET 0 4th Dec 2008 09:48 AM
custom key commands grammatim Microsoft Word Document Management 15 11th Aug 2008 09:48 PM
Executing custom sql-commands Bart Microsoft ASP .NET 0 8th Feb 2006 12:01 AM
Custom Commands and IMenuCommandService =?Utf-8?B?UmFtZXNo?= Microsoft Dot NET Framework 0 19th Dec 2005 09:05 PM


Features
 

Advertising
 

Newsgroups
 


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