Custom Menus

B

Barkingmadscot

I never done this i am having problem with get my buttons to run a
sub/function i have. See code below. I can create the menu, i can add
the action on click

I have tried .onaction = run("myfuc"), but runs my fucntion as the menu
is created.

Can some point me in the right direction please

******************************************************************************

Set cb = CommandBars.Add(Name:="Engineering", Position:=msoBarTop,
Temporary:=True)

With cb
Set ctlEnablePPDS = cb.Controls.Add(msoControlButton, ID:=1)
Set ctlDisablePPDS = cb.Controls.Add(msoControlButton, ID:=2)
.Visible = True
End With

With ctlBut1
.Caption = "Enable"
.Style = msoButtonCaption
End With

With ctlBut2
.Caption = "Disable"
.Style = msoButtonCaption
End With

********************************************************************************
 
B

Bob Phillips

..onaction ="myfuc"

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

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