Solved

Remove 2003 custom toolbar from Excel 2007

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
macro for same location path 2 19
Fixing a embedded format 7 29
Excel Copy Macro down foe each row 4 20
Excel Hyperlink Question 4 31
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

920 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

15 Experts available now in Live!

Get 1:1 Help Now