I have build an Excel project in VSTO using VB.Net and have included a new PivotTable context sensitive ribbon. Using the following function in ThisWorkbook.vb, it loads correctly and all works fine.
Protected Overrides Function CreateRibbonExtensibilityObject() As Microsoft.Office.Core.IRibbonExtensibility
However, I have now created another context-sensitive ribbon for PivotCharts. It seems the above 'Protected Overrides Function' can only be used to load 1 new ribbon (using Return New OdysseusToolsRibbon()) - it simply ignores the second line of code (Return New OdysseusChartRibbon()). I only need this second ribbon loaded when a PivotChart (or chart) is selected.
What event can I use to determine if a chart has been selected? ThisWorkbook_SheetSelectionChange is not triggered when you select a chart.
Also, assuming I can find when a chart is selected, how do I load the new ribbon? Is declaring it as a new ribbon enough? eg: Dim myChartRibbon As New OdysseusChartRibbon()