Create toolbar-help

  • Thread starter Thread starter jminu
  • Start date Start date
J

jminu

Hi,

I want to create a new toolbar(lets say abc) and want to add button
x,y,z to toolbar abc.

Pls help.

Thanks,
Min
 
Hi Minu

Firstly I'm a newbie but this code works to add a commandbar and one button.
To add more buttons copy and paste the 'Add the Welcome screen macro to the
End With. FaceId is the picture that will appear on the button - someone
recently posted here with the MS address for an excellent program at the MS
website to show all the FaceId's but be warned that they don't all appear in
the various versions of Windows/Office. If there is more efficient code
please reply to the group. You will need to experiment with your A,B & C's
but check_weigh & welcome are mods in the code. I call this code from my
workbook_open macro and delete it in my workbook_beforeclose.
Giving back
Mark (InWales)

Public Sub Custbuttons()
Dim check_weigh As CommandBar
Set check_weigh = _
Application.CommandBars.Add("CheckWeigh", BarNoChangeDock)

'Add the Welcome screen Macro
Dim welcome As CommandBarButton
Set welcome = check_weigh.Controls.Add(msoControlButton)
With welcome
..Caption = "Welcome Screen"
..OnAction = "thisworkbook.well"
..Visible = True
..Style = msoButtonIconAndCaption
..FaceId = 59
End With
 

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

Back
Top