D
Dale Fye
I've added a commandbar (see code below) to my userform, which pops up
another userform. The first time I open this command bar and click on the
POC Info button, it opens the second form properly, but when I select click
on the label that pops this menu up a second time, there is a check in front
of the POC Info option, and clicking on it does nothing.
Any ideas what I am doing wrong?
Sub OptionsMenu()
Dim CmdBar As Office.CommandBar
Dim ctrl As Office.CommandBarControl
On Error Resume Next
Application.CommandBars("MyOptions").Delete
On Error GoTo 0
Set CmdBar = Application.CommandBars.Add(Name:="MyOptions", _
Position:=msoBarPopup, _
temporary:=True)
Set ctrl = CmdBar.Controls.Add(Type:=msoControlButton)
With ctrl
.Caption = "POC info"
.OnAction = "POC_Info"
End With
End Sub
Public Sub POC_Info()
Userform1.Hide
frm_POC_Info.Show
Userform1.Show
End Sub
Dale
another userform. The first time I open this command bar and click on the
POC Info button, it opens the second form properly, but when I select click
on the label that pops this menu up a second time, there is a check in front
of the POC Info option, and clicking on it does nothing.
Any ideas what I am doing wrong?
Sub OptionsMenu()
Dim CmdBar As Office.CommandBar
Dim ctrl As Office.CommandBarControl
On Error Resume Next
Application.CommandBars("MyOptions").Delete
On Error GoTo 0
Set CmdBar = Application.CommandBars.Add(Name:="MyOptions", _
Position:=msoBarPopup, _
temporary:=True)
Set ctrl = CmdBar.Controls.Add(Type:=msoControlButton)
With ctrl
.Caption = "POC info"
.OnAction = "POC_Info"
End With
End Sub
Public Sub POC_Info()
Userform1.Hide
frm_POC_Info.Show
Userform1.Show
End Sub
Dale