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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Celly

Board Regular
Joined
Jan 29, 2015
Messages
84
Office Version
  1. 2016
Platform
  1. Windows
I believe I answered my own question...there is a "Chart Menu Bar" in there as well. I'll try that one.
 
Solution

Forum statistics

Threads
1,148,141
Messages
5,745,038
Members
423,917
Latest member
Frank1931

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
Top