View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Customizing a toolbar wit new icons

There are basically two ways to do this. You can load a picture from
an external file or you can embed a picture on a worksheet.

Using an external file:
===============
Sub AAA()
Dim Btn As Office.CommandBarButton
Set Btn = Application.CommandBars("Standard"). _
Controls.Add(Type:=msoControlButton, temporary:=True)
With Btn
.Picture = LoadPicture("C:\TestPic.bmp")
.OnAction = "Clicked"
End With
End Sub


Using an embedded pictu
=====================
Sub BBB()
Dim P As Excel.Picture
Dim Btn As Office.CommandBarButton
Set P = Worksheets("Sheet1").Pictures("ThePict")
P.CopyPicture xlScreen, xlBitmap
Set Btn = Application.CommandBars("Standard"). _
Controls.Add(Type:=msoControlButton, temporary:=True)
With Btn
.PasteFace
.OnAction = "Clicked"
End With
End Sub


Both of these procedures will create a new button on the Standard
command bar and apply the picture to the button.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)





On Mon, 23 Feb 2009 09:12:18 -0800 (PST), avi
wrote:

Hello,

I've seen some third party applications in Excel that create a toolbar
with icons that differ from the faceids provided by Excel

Do you know how is it possible to create such toolbars?

Thanks a lot
Avi