T
Trefor
In a module of a xla:
Sub Create_DCA_Menu()
Dim mynewbar, button1, button2, button3
Set mynewbar = CommandBars(1).Controls.Add(Type:=msoControlPopup,
Temporary:=True)
With mynewbar
.Caption = "DCA Menu"
End With
Set button1 = mynewbar.Controls.Add(Type:=msoControlButton)
With button1
.Caption = "Open Menu"
.OnAction = ThisWorkbook.Name & "!Open_Menu"
End With
End Sub
When I select the command bar button1 it tries to run "Open_Menu" in a
different xla.
I have multiple XLA files at different versions and they all have this same
Sub. Even though I specified ThisWorkbook.Name it still goes to the other
xla. What am I doing wrong?
Sub Create_DCA_Menu()
Dim mynewbar, button1, button2, button3
Set mynewbar = CommandBars(1).Controls.Add(Type:=msoControlPopup,
Temporary:=True)
With mynewbar
.Caption = "DCA Menu"
End With
Set button1 = mynewbar.Controls.Add(Type:=msoControlButton)
With button1
.Caption = "Open Menu"
.OnAction = ThisWorkbook.Name & "!Open_Menu"
End With
End Sub
When I select the command bar button1 it tries to run "Open_Menu" in a
different xla.
I have multiple XLA files at different versions and they all have this same
Sub. Even though I specified ThisWorkbook.Name it still goes to the other
xla. What am I doing wrong?