How to remove Help button from CommandBar Popup menu

574 Views Asked by At

I'm using the Application.CommandBars.Add method to create a custom PopUp menu.

I'm on a Mac with OS 10.8 and using Excel for Mac 2011.

I get a Help button at the top of menu that I didn't ask for. It does work, as in it launches the Help Center. I just don't want it on this right-click menu. None of the code examples or discussion threads that I have found by searching this and other sites mention anything about this. How does it get there and what I can do to remove it?

I can't get at it with an index to the controls, or by its name:

  • CommandBars(MyMenu).Controls(1).Delete ........... removes my first command button ("Button 1")
  • CommandBars(MyMenu).Controls(0).Delete ........... fails - subscript out of range (duh)
  • CommandBars(MyMenu).Controls("Help").Delete ... fails - invalid argument

And likewise with trying to make it ".Enabled = False" or ".Visible = False".

Is there a way to get at it with the "Id:=30010"?

Is there some argument or property to the CommandBars.Add or ShowPopup methods that will tell it, "Don't 'Help' me so much, thanks."?

The code is exactly what you find on the MSDN site example for Creating Popup Menus so I won't add that here.

I don't have enough reputation points to post the screen snapshot of what it looks like when displayed with a Right-Click event. There is a "Help" button at the top of the menu, a separator line, then the buttons I defined on the menu.

0

There are 0 best solutions below