Solved

Remove 2003 custom toolbar from Excel 2007

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
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…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

738 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