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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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