L
Luc Benninger
Hi
I use the code below to insert a new commandbar button to the standard
commandbar of the VBA editor. But the OnAction property seems not to work.
Why? Using Excel 2003.
Thanks for any hints, Luc
' ******************************************
Public Sub CreateButton()
With Application.VBE.CommandBars("Standard")
.Visible = False
With .Controls.Add(msoControlButton, , , 1, True)
.FaceId = 123
.Style = msoButtonIcon
.OnAction = "DoIt"
End With
.Visible = True
End With
End Sub
Public Sub DoIt()
MsgBox "done"
End Sub
I use the code below to insert a new commandbar button to the standard
commandbar of the VBA editor. But the OnAction property seems not to work.
Why? Using Excel 2003.
Thanks for any hints, Luc
' ******************************************
Public Sub CreateButton()
With Application.VBE.CommandBars("Standard")
.Visible = False
With .Controls.Add(msoControlButton, , , 1, True)
.FaceId = 123
.Style = msoButtonIcon
.OnAction = "DoIt"
End With
.Visible = True
End With
End Sub
Public Sub DoIt()
MsgBox "done"
End Sub