ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Customizing a toolbar wit new icons (https://www.excelbanter.com/excel-programming/424556-customizing-toolbar-wit-new-icons.html)

avi

Customizing a toolbar wit new icons
 
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


Chip Pearson

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



All times are GMT +1. The time now is 10:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com