I am trying, rather unsuccesfully, to create a custom menu that will call a user form. I am having quite a bit of difficulty with the .onaction property.
This code is placed in a AddMenus() sub in ThisWorkBook and is called when the work book opens:
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "&Agenda Editor"
.OnAction = " ' " & ThisWorkbook.Name & " '!AgendaEditor"
.Enabled = False
End With
.
.
.
(I want it to call this sub, placed directly under the above sub)
Sub AgendaEditor()
frmAgenda.Show
End Sub
When executed it tells me that the macro cannot be found.
This code is placed in a AddMenus() sub in ThisWorkBook and is called when the work book opens:
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "&Agenda Editor"
.OnAction = " ' " & ThisWorkbook.Name & " '!AgendaEditor"
.Enabled = False
End With
.
.
.
(I want it to call this sub, placed directly under the above sub)
Sub AgendaEditor()
frmAgenda.Show
End Sub
When executed it tells me that the macro cannot be found.