Worksheet Menu Bar / Chart Sheet

Celly

Board Regular
Joined
Jan 29, 2015
Messages
84
Office Version
  1. 2016
Platform
  1. Windows
Greetings!

I have a workbook with a chart sheet and custom menus. The custom menus appear under the top level "Add-ins" Excel menu and are created as follows:

VBA Code:
Dim mainMenuBar As CommandBar
Dim helpMenu As Integer

Set mainMenuBar = Application.CommandBars("Worksheet Menu Bar")
     
helpMenu = mainMenuBar.Controls("Help").Index
     
Set mainMenu = mainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=helpMenu)
    
With mainMenu
    
    .Caption = "MyMenu"
    .OnAction = "MyMenuMacro"
         
End With

This works fine, however when the chart sheet is the active sheet, the Add-ins menu does not contain the MyMenu item. You have to know to switch to a regular sheet for it to re-appear.

This is an annoyance as my menu launches macros which dynamically change the chart. Is there any way around this oddity?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I believe I answered my own question...there is a "Chart Menu Bar" in there as well. I'll try that one.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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