Solved

Remove 2003 custom toolbar from Excel 2007

Posted on 2010-09-10
4
1,432 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
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.

749 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