Solved

Remove 2003 custom toolbar from Excel 2007

Posted on 2010-09-10
4
1,408 Views
Last Modified: 2012-05-10
I have an application with an Excel workbook as the user interface.  I am migrating it from 2003 to 2007.  In 2003, I had a custom toolbar with three buttons to run specified procedures.  In the Workbook_Open event I used the following code to assign the procedures to the toolbar buttons
        'assign macros(functions) to custom toolbar buttons
        'constants declared/assigned top of this module
    'Excel.CommandBars(TOOLBAR).Controls(1).OnAction = LINKMACRO
    'Excel.CommandBars(TOOLBAR).Controls(2).OnAction = REFRESHMACRO
    'Excel.CommandBars(TOOLBAR).Controls(3).OnAction = UPDATEMACRO

        'display custom toolbar
    'Application.CommandBars("RunCode").Visible = True

For 2007 I've modified the Ribbon to include buttons to do the same and am now wanting to remove the custom toolbar (which appears as a custom Add-Ins tab in the Ribbon).  I can't for the life of me figure out how to remove it.  I've tried
Renaming/deleting the Excel12.xlb file from the C:\Users\username\AppData\Roaming\Microsoft\Excel folder
Right-clicking the custom menu items in the Add-Ins tab and choosing delete (the tab disappears but reappears the next time I open the workbook).

The workaround I am using right now is to issue the following on the Workbook)Open even
Application.CommandBars("RunCode").Delete
Which works but if I remove that line of code the Add-Ins tab is back with the custom toolbar items.

I've looked at the attachedToolbars.bin file in Notepad and see that it contains
                    R u n C o d e ÷L f kÎ Åü  þ÷L f kÎ Åü  þ÷L f kÎ Åü ÿ   … 3 ¨ A & A c t i v a t e L i n k s       T h i s W o r k b o o k . A d d H y p e r l i n k  € … 2 ¨ A  & R e f r e s h D a t a       T h i s W o r k b o o k . R e f r e s h S h e e t s  € … 2 ¨ A & U p d a t e D a t a b a s e       T h i s W o r k b o o k . U p d a t e D a t a b a s e  €
These are the three custom toolbars and the respective procedures they are connected to.  I cannot delete the file however.

Ant ideas?
Thanks,
OM Gang
0
Comment
Question by:omgang
  • 3
4 Comments
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 500 total points
ID: 33652409
i recall having to open the workbook in XL97  (thats what I had till XL07!), remove the toolbar manually and resave as new file.
Then in XL07, writing a WB_Open routine to add the Toolbar manually.  

Very unscientific so may not be the solution you are looking for as I only had 3 workbooks with toolbars.
0
 
LVL 28

Author Comment

by:omgang
ID: 33661768
I believe I tried that last week.  I opened the file in Excel 2003.  Removed the toolbar and resaved.  I may have done it as an xlsm file though.  I'll try opening it again in Excel 2007, deleting the toolbar and saving as a new 2003 xls file.  Then I'll open it in 2007 and report back.

Thanks,
OM Gang
0
 
LVL 28

Author Comment

by:omgang
ID: 33661775
Sorry, meant
 I'll try opening it again in Excel 2003,
OM Gang
0
 
LVL 28

Author Comment

by:omgang
ID: 33666075
It worked.  I first copied the custom RibbonX xml to a text file (so I wouldn't lose it).  Then I opened the 2007 .xlsm file in Excel 2003.  From the Tools menu I selelcted Customize and then Selected the custom toolbar.  Simply selecting it and deleting it didn't remove it permanently however (when I re-opened the workbook the toolbar came back.....like a rash).  I selected the custom toolbar and then clicked the Attach... button.  From that dialogue box I selected the custom toolbar from the right side (toolbars in workbook) and then clicked the Delete button.  Back in the Customize dialogue box I also (again) selected the custom toolbar (it was still listed) and chose Delete.  I saved the workbook as an Excel 2003 .xls file.  I then opened the 2003 .xls file in Excel 2007 and no more custom toolbar.  I saved the workbook as a 2007 .xlsm file.  I then reattached my custom RibbonX xml file and am good to go.
Thanks for pointing me in the correct direction!
OM Gang
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now