View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.office.developer.vba
Frans van Zelm Frans van Zelm is offline
external usenet poster
 
Posts: 10
Default OnAction-property of cbbutton in VBE editor

Dear Bob,

I try to create a working VBA commandbar.

Frans

"Bob Phillips" wrote in message
...
Are you trying to add to worksheet commandbars, or the VBA commandbars?

--
HTH

Bob Phillips

"Frans van Zelm" wrote in message
...
Hi,

((VB-editor of Excel 2K, Dutch version; Windows 2K Server))

I hoped to make a custom button work by:

Sub BrandNewBarAndButton()
Dim myBar As CommandBar
Dim myControl
Set myBar = Application.VBE.CommandBars.Add("Extra", , False, True)
myBar.Visible = True
Set myControl = myBar.Controls.Add(msoControlButton, , , 1)
With myControl
'Other properties set
.OnAction = "LittleClick"
End With
End Sub

The precedure LittleClick in the same module. But ... clicking the
button has no result.

I also noticed the Click-event but I expect that then a class module ;-(
etc. is needed.

Thanks for a reply, Frans