How do I remove a custom toolbar from an Excel workbook? - excel

I'm using Excel 2007, and I have an Excel workbook with a custom toolbar attached. Every time I open the workbook, the toolbar appears on the ribbon under "Add-ins". I can right-click on the toolbar and choose Delete Custom Toolbar and that removes it. But when I re-open the workbook, it re-appears. How do I remove it for good?
The toolbar is not created by VBA. It was attached to the workbook in an earlier version of Excel using the steps outlined in http://office.microsoft.com/en-us/excel/HP051986401033.aspx.

I realize this is an old question, but I just found an easy solution not mentioned on here that will be of use to future viewers:
Change the file's extension to ".zip"
Open the archive
Delete the Attachedtoolbars.bin file from the archive
Close the archive
Change the file's extension back to what it was originally

While the proper solution is detaching the toolbar from the workbook, I'm not sure how that is done in Excel 2007. As a workaround, a macro can be used to delete the toolbar every time the workbook is opened:
Private Sub Workbook_Open()
' Delete the unwanted toolbar that is attached to this workbook.
Dim cmdbar As CommandBar
For Each cmdbar In Application.CommandBars
If cmdbar.Name = "Zap" Then
cmdbar.Delete
End If
Next End Sub
End Sub

I found two ways wich worked for me:
Open in Office 2003 and detach the custom toolbar: Tools > Customize > Tab Toolbars > Button Attach... > Delete custom toolbar in workbook
Open in Office 2007 and export all Objects, Forms, Modules and Class Modules and import them into a new fresh workbook (.xlsm)
You will get rid of all old garbage and all macro's still work.

If it is not VBA you could go into the registry to disable the Addin associated with the toolbar.

You can also loop through all the Commandbars in Excel.Application.CommandBars and find toolbar by its name, and delete it then. This is assuming the toolbar is stuck there from a previous session (and that the workbook/addin/etc that added the toolbar didn't remove it in the Workbook_Beforeclose event)

Or, if it is not done in VBA, you could just simply:
Right click in the menu bar region, click customize
In the Toolbar tab click on attach and make sure it is not attached to the workbook.
Sometimes people forget the basics...

I had the same problem with a spreadsheet which displayed a custom toolbar, then left it in my default toolbar file.
I found this solution:
http://support.microsoft.com/kb/291074
In Excel 2007, the file to delete is
c:\Winnt\profiles\username\Application Data\Microsoft\Excel\Excel12.xlb
Worked perfectly for me (though it deletes all custom toolbars you might have installed).

I know this question is old, but what finally worked for me is going into the bin/debug folder of my excel addin project and deleting all the files, then reloading Excel.

See the answer here:
http://msdn.microsoft.com/en-us/library/office/ff862231%28v=office.15%29.aspx
For Each bar In CommandBars
If bar.BuiltIn = False Then
bar.Delete
End If
Next bar

In all likelihood, there is VBA code attached to the workbook with an onLoad event that creates the toolbar.
You'll have to go delete or disable the VBA code.

We have the same problem with the ribbon in our production 2010 Excel spreadsheets that need changes. The custom ribbon needs to be modified but it is locked at every location from we have tried to edit/remove it.
Right-clicking on the toolbar does not work since the "Customize..." selections are disabled.
Removing all the VBA code has no effect, the custom ribbon still replaces the default ribbon.
In Excel Options, the "Customize the Ribbon" controls contain no selections or are disabled.
In the VBA window under View, Toolbars, Customize, the Menu Bar toolbar is locked for editing.
We have tried to locate files on the hard disk as suggested by a few posts, but the files are not found (even the folder hierarchy does not exist).
Options off the table are editing the registry or creating entirely new files by importing objects.
Question: Why do they make it so difficult to manage the ribbon?

Related

VBA - iRibboncontrol & different Sub not working

I have a macro-enabled excel workbook that has a custom menu with different buttons that work beautifully - used Custom-UI editor for this.
When I try to create a new Macro that runs and starts a custom menu with custom menu items, it does not want to work.
If I create a new macro-enabled workbook without a custom menu (iRibboncontrol items), then the menu code works.
Is there a way to have both the iRibboncontrol Custom Ribbon AND a custom menu? If so, please can someone assist?
Update
Figured out that Page Break Preview is the reason why my custom right-click menu breaks.
Any suggestions on how to get it working?

Remove a tab in Ribbon in Excel for Mac

I have made an add-in ("Funfun") by myself. The manifest files are a little bit messy. Curiously, I cannot remove that add-in from Ribbon anymore in Excel for Mac.
I tried to "reset all customizations", and to re-install Excel, but the Funfun tab is still there. As a consequence, I cannot load the right manifest file to debug that add-in.
Does anyone know how to remove that tab, and start from the very beginning?
According to Excel for Mac documentation:
Remove tabs: You can remove custom tabs only from the Ribbon. To remove, select your tab in the Customize the Ribbon box and click Office 2016 for Mac Customize Ribbon Remove Button
Ref: https://support.office.com/en-ie/article/customize-the-ribbon-and-toolbars-in-office-for-mac-26911d4c-4971-41cd-b606-5fbc0318f499
Try deleting the Office cache to clear out the record of custom buttons and tabs. Details can be found here: Changes to add-in commands including ribbon button and menu items do not take effect.

excel vba code password protected would not disappear

I have opened an excel file containing VBA password protected (not belonging to me) and from that moment on what happens is that the code remains in the VBA editor even if I close ALL the files (see atteched pic)
Such filed was called treelist and in the VBA editor "solver.XLMA"
Put in other words. Whatever excel of mine I opened now with or without vba code once I click "editor" the first thing I see is that "solver.XLMA" that I can not access nor delete. It is really anoying because I dont know what this code is doing.
(note: yes, I closed excel several times and opened it again. solver.xlma was still there)
As you see in the picture the "solver.xlma" stais even if I close all the excel workbooks.
Some idea of how can I get rid of it and what is going on here?
thx
It is a solver add-in. To turn it off:
Click the File tab, click Options, and then click the
Add-Ins category.
In the Manage box, click Excel Add-ins, and then click Go. The Add-Ins dialog box appears.
In the Add-Ins available box, clear the check box next to the add-in that you want
to deactivade (Solver), and then click OK.
This is the answer:
That's the Solver Add-In. Go to File > Options > Add-Ins, then click Go beside "Manage Excel Add-ins". Uncheck the Solver Add-in and hit Ok

Macro button under customized ribbon tab tries to open old Excel file

I created a custom ribbon tab on my Excel like Excel_app_v1.xlsm, and a button under this ribbon tab is connected to a macro. So when I click this button, the macro does some table importing applications.
The first strange thing is that I created this ribbon tab and the button for only this Excel file, but the ribbon tab and the button appear in all other Excel files, even if the original Excel file Excel_app_v1.xlsm is not open.
The second problem is that I created a second version of my previous Excel file with "Save-as" option. So the new Excel file is like Excel_app_v2.xlsm. When I click the button under the ribbon tab, it opens the first Excel file Excel_app_v1.xlsm, even if it is not open. I deleted the first Excel file, but then I got an error like "Couldn't find the Excel_app_v1.xlsm on the path".
So obviously the macro button under the customized ribbon tab is linked to the first Excel file, but I couldn't find the menu option to change this. I added ThisWorkbook before all the sheet expressions in the vba code, but it didn't solve the problem. The button-click is still trying to open the old excel file.
The VBA code is below. The button is linked to the Sub ImportTable. Firstly it asks the user if the user wants to continue with the process. It opens the previous Excel file right after clicking on the button, at the same time as the Message Box appears.
Sub ImportTable()
Application.ScreenUpdating = False
YearMonth = ThisWorkbook.Sheets("tab1").Cells(11, 2).Value
' The Macro button opens the previous Excel file before clicking Yes or No on the message box
answer = MsgBox("Warning! Brings the newest source file. You want to continue?", vbYesNo + vbQuestion, "")
If answer = vbYes Then
RunSASCodeViaBatFile ' Another Sub which runs bat file to run a SAS-code. But it doesn't matter. Because the problem happens before I click on Yes or No.
InsertSASFileIntoExcel
Else ' Nothing happens if clicking No on the Message Box
End If
End Sub
The clue to fixing this quickly was posted below by roncruiser, with one slight twist.
Everyone on the web seems to feel that PERSONAL.XLSB is the key here — nope. In fact, playing with that file only confounded me for even longer. Here's what I did instead:
Right click the Ribbon and select Customize The Ribbon;
Navigate to the offending macros that you've installed with buttons;
Find and click on Import/Export;
Export your custom buttons (the macros will go right along just fine);
Open that resulting file, and edit out the offending references to the other file that's causing you so much grief — example:
<mso:button idQ="x1:HideRows_0_EA10D6" label="HideRows" imageMso="_3DPerspectiveDecrease" onAction="!HideRows" visible="true"/>
I took out everything after idQ-"x1... up to the actual name of the macro. I also took out the same external reference found in onAction="... Take everything up to the bang mark.
Save this under whatever name you wish, but with the same extension (for my setup, it was called ExportedCustomizations.exportedUI (yes, that long an extension));
Repeat the first few steps here, but this time import your edited file.
Voila, all is golden.
No messing around with wiping out existing work and starting all over. Worked a charm for me, so a big tip o' The Hat to roncruiser for the clue.
Just to confirm what sumgain have write above.
It works perfectly just do as he said : remove the part after the "x1:" that refers to a specific workbook until the begining of the maccro's name.
example :
When you export your custom ribbon with the maccro attached to it it will be write like below :
idQ="x1:C:_FolderName_Filename.xlsm_Fill_Formulas_Cells"
THen you remove the part mentionned and it will become like that :
idQ="x1:Fill_Formulas_Cells"
Same for onAction keep only the Maccro Name
Then it will works perfectly as long as you the maccro's name in the workbook stay consistent if you modified the Macros name then you have to modified it in the exportedUI file.
Then when you will reload the new file you can check in the Excel Options customize ribbon on the customize button if you put the pointer on you will see "Maccro: Name of your maccro"
And not the path of the file the maccro was from.
No need to use custom UI editor or any other things such as personnal maccro at least for that and if you are not bother to have custom ribbon in all of your woorkbook.
As well it is obvious but still good to remind it, you need to have the maccro in the workbook this procedure is just there to call the maccro that are associate to the workbook, it doesn't contain the code of the maccro.
Cheers
Romain
Does this still work? I have done this in the past with success but can't seem to get it to work now.
I export the file, edit it and import it back in.
it appears to work, but when i close the Ribbon options pane, my custom buttons disappear.
Same exact thing happened to me. There's a way to get around this.
By default, when you create a macro in Excel and run that macro through a custom ribbon button, that ribbon button macro works only in the workbook that contains it.
To get around this and have the button macros work in all workbooks, you'll need to create a Personal Macro Workbook. Then any macros that you store in your personal workbook on a computer become available to you in any workbook whenever you start Excel on that same computer.
Create a Personal Macro Workbook
To get the same ribbon button macros to work on another computer, you'll need to copy the Personal Macro Workbook to another computer and store it in the XLSTART folder. The link above has all the information you'll need.
Note: Delete the old ribbon button macros. Make sure you create new ribbon button macros that reference the macros from your Personal Macro Workbook.

Excel 2007 macro buttons greyed out

My macro options are greyed out in Excel 2007. i've adjusted the settings in the trust center and attempted to install the VBA add-in.
I cant record or enable any macros. How do I fix this?
Thanks.
figured it out - it had to do with the initial install. the option to install "with VBA components" was never selected. had to uninstall, then re-install.
now it works beautifully. thanks for the help!
Jason,
The first thing to check is if you can run any macro's at all. What happens when you have the sheet with the macro buttons open and you then open the macro selector ([Alt]+[F8])?
If you can see and run the macro's from there, then you know that running the macro's is not blocked. In that case you could try to add a new set of buttons and throw the old (non-functioning) buttons away. Adding a button is easy. Make sure you have the "developer" tab available (enable in options) and select "controls", "insert". When you click on the button icon, a list of available macros should pop-up.
What I think has happened though is that the macro's where stored in PERSONAL.XLSB and that the sheet (with the buttons) does not contain the macro's. I.e. the sheet is an xlsx file and not an xlsm file. If the macro's where stored on an other sheet, you will have to copy the macro's to the sheet with the buttons. Use [Alt]+[F11] to open the macro editor and copy the macro's to the new sheet. In the macro editor, you will probably have to create a folder "Modules" by selecting "insert", "Modules".
If you need more help, just ask.
Regards,
Robert Ilbrink

Resources