?
Solved

Remove 2003 custom toolbar from Excel 2007

Posted on 2010-09-10
4
Medium Priority
?
1,461 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 2000 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 describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

765 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