![]() |
Add control to the Chart menu of "Chart Menu Bar" commandbar
Can anyone help me to get the following to work? It works fine when
adding a button to the menus on the "Worksheet Menu Bar" (eg. replace "Chart" with "File") but I can't seem to get it to work for the Chart menu. Sub AddCltToChartMenu() Dim cbct As CommandBarControl Set cbct = Application.CommandBars("chart").Controls.Add(msoC ontrolButton) cbct.Caption = "Test" End Sub Thanks, Andrew |
Add control to the Chart menu of "Chart Menu Bar" commandbar
Sub AddCltToChartMenu()
Dim cbct As CommandBarControl Dim cbPop As CommandBarPopup Set cbPop = Application.CommandBars("Chart Menu Bar").Controls("&Chart") Set cbct = cbPop.Controls.Add(msoControlButton) cbct.Caption = "Test" End Sub -- Regards, Tom Ogilvy Andrew wrote in message om... Can anyone help me to get the following to work? It works fine when adding a button to the menus on the "Worksheet Menu Bar" (eg. replace "Chart" with "File") but I can't seem to get it to work for the Chart menu. Sub AddCltToChartMenu() Dim cbct As CommandBarControl Set cbct = Application.CommandBars("chart").Controls.Add(msoC ontrolButton) cbct.Caption = "Test" End Sub Thanks, Andrew |
Add control to the Chart menu of "Chart Menu Bar" commandbar
Thanks Tom - that's excellent.
I suspected it was tied up with referencing the chart menu bar but couldn't figure out how to reference it and add a control. Referencing to the CommandBarPopup was the trick! Thanks again, Andrew "Tom Ogilvy" wrote in message ... Sub AddCltToChartMenu() Dim cbct As CommandBarControl Dim cbPop As CommandBarPopup Set cbPop = Application.CommandBars("Chart Menu Bar").Controls("&Chart") Set cbct = cbPop.Controls.Add(msoControlButton) cbct.Caption = "Test" End Sub -- Regards, Tom Ogilvy Andrew wrote in message om... Can anyone help me to get the following to work? It works fine when adding a button to the menus on the "Worksheet Menu Bar" (eg. replace "Chart" with "File") but I can't seem to get it to work for the Chart menu. Sub AddCltToChartMenu() Dim cbct As CommandBarControl Set cbct = Application.CommandBars("chart").Controls.Add(msoC ontrolButton) cbct.Caption = "Test" End Sub Thanks, Andrew |
All times are GMT +1. The time now is 01:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com