OnAction property not working

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
 
L

Luc Benninger

Andy, thanks for your response. But I didn't find any example about the VBE
menu. I have not problems dealing with Excel command bars. Any other hints?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top