tags:

views:

1234

answers:

5

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.

A: 

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.

BradC
I removed all the VBA code, but I still wasn't able to remove the toolbar.
A: 

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

Roger
A: 

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)

Jon Fournier
A: 

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
A: 

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...

WnG88