View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mark \(In Wales\) Mark \(In Wales\) is offline
external usenet poster
 
Posts: 5
Default Create toolbar-help

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

"jminu " wrote in message
...
Hi,

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

Pls help.

Thanks,
Minu


---
Message posted from http://www.ExcelForum.com/