How to remove custom toolbar from Excel workbook?

I am using Excel 2007, and I have an Excel workbook with a custom toolbar attached. Each time I open a book, a toolbar appears on the ribbon in the "Add-ons" section. I can right-click on the toolbar and select "Delete Custom Toolbar" and delete it. But when I open the book again, it appears again. How to remove it permanently?

Toolbar is not created by VBA. It was attached to a workbook in an earlier version of Excel using the steps described at http://office.microsoft.com/en-us/excel/HP051986401033.aspx .

+3
source share
11 answers

While the correct solution separates the toolbar from the workbook, I'm not sure how to do it in Excel 2007. As a workaround, you can use a macro to remove the toolbar every time the workbook opens:

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
+3
source

I understand this is an old question, but I found a simple solution, not mentioned here, that would be useful for future viewers:

  • Change the file extension to ".zip"
  • Open archive
  • Delete Attachedtoolbars.binfile from archive
  • Close archive
  • Change the file extension to what was originally
+3
source

, :

  • Office 2003 : > > > ... >

  • Office 2007 , , (.xlsm) , .

+2

VBA, , Addin, .

+1

Excel.Application.CommandBars . , ( /addin/etc, , Workbook_Beforeclose)

+1

, VBA, : , " " "" , .

...

+1

, , .

: http://support.microsoft.com/kb/291074

Excel 2007 c:\Winnt\profiles\_\ \Microsoft\Excel\Excel12.xlb

( , , , ).

+1

, , , , , bin/debug excel addin , Excel.

+1

. :

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 
+1

, VBA onLoad, .

VBA.

0

Excel 2010, . , , / .

, "..." .

VBA , - .

Excel " " .

VBA "", " ", "" " " .

, , ( ).

.

: ?

-1

Source: https://habr.com/ru/post/1707798/


All Articles