I have an Excel add-in for statistical analysis that creates a commandbar with some menu/sub-menu. The code that I use is below:
Sub CreateMyMenu()
Dim cbBar As CommandBar
Dim cbCtrl As CommandBarControl
Dim cbCtrl1 As CommandBarControl
Dim cbCtrl2 As CommandBarControl
Dim cbCtrl3 As CommandBarControl
Dim cbCtrl4 As CommandBarControl
Dim cbCtrl5 As CommandBarControl
Dim cbCtrlHelp As CommandBarControl
Dim cbPop As CommandBarPopup, cbPop1 As CommandBarPopup, cbPop2 As CommandBarPopup, cbPop3 As CommandBarPopup
' Delete the CommandBar if it exists already
On Error Resume Next
Application.CommandBars("CreditScoringSuite").Delete
Set cbBar = CommandBars.Add("CreditScoringSuite")
Set cbPop = cbBar.Controls.Add(Type:=msoControlPopup)
'add a popup menu To the custom menu
With cbPop
.Caption = "CSS G1 - Xform"
.TooltipText = "Welcome! Let's get started ..."
.BeginGroup = True
End With
'-----------------------codes truncated---------------
' Show the command bar
cbBar.Visible = True
End Sub
I also have the following code in "ThisWorkbook"
Private Sub Workbook_Open()
CreateMyMenu
End Sub
The issue I am facing is that the commandbar does not appear in the add-in tab although it is activated. I have been using this add-in for many years but my office switched to Excel365 recently and since then this behaviour is noted.
appreciate any guidance.
EDIT : Based on advice I created a custom ribbon (see pic). Tested in a separate .xlsm file. However when I integrate this within my .xlam add-in the macros do not run automatically and the custom tab does not get created. Seems like the same issue that during launch of Excel as an application these codes are not getting executed.enter image description here