Custom controls not showing in Add-ins ribbon tab and XML error

Shneuph

New Member
Joined
Jul 17, 2013
Messages
7
Hello..

This is my first time posting a question so I'm sorry if I don't follow protocol exactly. I'll try.
We are using Windows7 with Excel 2007. We have old code from excel 2003 and earlier that was adding a msoControlPopup with other sub-controls using the code below:
Code:
    Set HelpMenu = CommandBars(1).FindControl(Id:=30010)
    
    If HelpMenu Is Nothing Then
'       Add the menu to the end
        Set AirFlowMenu = CommandBars(1).Controls.Add _
          (Type:=msoControlPopup, temporary:=True)
    Else
'      Add the menu before Help
        Set AirFlowMenu = CommandBars(1).Controls.Add _
          (Type:=msoControlPopup, Before:=HelpMenu.Index, temporary:=True)
    End If

'   Add a caption for the menu
    AirFlowMenu.Caption = "&Air Circulation"
    
'   FIRST MENU ITEM A
    Set MenuItem = AirFlowMenu.Controls.Add _
      (Type:=msoControlButton)
    With MenuItem
        .Caption = "&Save Air Circulation"
        .ShortcutText = "Ctrl+Shift+S"
        .FaceId = 3
        .OnAction = "SaveFileAsDir"
    End With

etc...

It still works in Excel 2007 and adds a pulldown in the Add-ins ribbon tab. However, randomly yesterday it stopped showing up in only MY add-ins ribbon tab. It still shows in other users ribbons. Now, I also checked the box in Excel Options>Advanced>Show Add-in user interface errors and when I have that checked I get this error when Excel opens:

msgbox title "Custom UI Runtime Error in Send to Bluetooth"
msgbox content:
Error found in Custom UI XML of "Send to Bluetooth":

Line:1
Column:199
Error Code 0xC00CEE21
Whitespace expected

buttons: OK, OK to All

(sorry, IDK if I can attach an image of that msgbox)

I tried going to Excel Options>Customize>Reset to reset any customizations to the quick access toolbar as this was recommended by something else I found online. This did not fix the problem.

I can find the control in the Immediate window but it just isn't showing in the add-ins tab.
Any suggestions? Does anyone know if I can find and repair that XML file perhaps?
Thank you.
 
The code is adding the custom controls to Commandbars(1) which is named "Worksheet Menu Bar" command bar. Somehow this command bar's "enabled" property had been set to false.
So setting the enabled property:
Code:
commandbars("worksheet Menu Bar").enabled = true 'or
commandbars(1).enabled = true
made everything appear again.
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top