A
Andibevan
I am trying to create a popup menu that will appear using the right mouse
button.
I have added the following to the form's Load function:-
Set myBar = CommandBars.Add(, position:=msoBarPopup, _
Temporary:=True)
Set myControl = myBar.Controls _
.Add(Type:=msoControlButton)
With myControl
.FaceId = 0
.OnAction = "MySub"
End With
And then placed the following in the mouse_up event
If Button = 2 Then
myBar.ShowPopup
End If
I have 2 problems
1) If I try to set the name of the custom bar it works the first time you
load the form, but not the second, it appears to already have the commandbar
loaded and can't create a duplicate.
2) I can't get the myControl button to run the MySub sub when it is pressed?
TIA
Andi
button.
I have added the following to the form's Load function:-
Set myBar = CommandBars.Add(, position:=msoBarPopup, _
Temporary:=True)
Set myControl = myBar.Controls _
.Add(Type:=msoControlButton)
With myControl
.FaceId = 0
.OnAction = "MySub"
End With
And then placed the following in the mouse_up event
If Button = 2 Then
myBar.ShowPopup
End If
I have 2 problems
1) If I try to set the name of the custom bar it works the first time you
load the form, but not the second, it appears to already have the commandbar
loaded and can't create a duplicate.
2) I can't get the myControl button to run the MySub sub when it is pressed?
TIA
Andi