Example The Delete CustomMenus Procedure

Sub DeleteCustomMenus()

Dim cbc As CommandBarControl

Set cbc = Application.CommandBars("Worksheet menu bar").

FindControl(Type:=msoControlPopup, Tag:="TestAddInCustomMenu")

If Not cbc Is Nothing Then cbc.Delete

Set cbc = Application.CommandBars("Chart menu bar"). FindControl(Type:=msoControlPopup, Tag:="TestAddInCustomMenu")

If Not cbc Is Nothing Then cbc.Delete End Sub

The pieces are now complete, so you can save the SRXUtils.xls file as an add-in, just as we did in Chapter 10. (If you have a problem, you can download the source code for this add-in from the O'Reilly web site and compare it with your code.)

0 0

Post a comment