Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Change toolbar icon in VBA

I want to set a collection of icons into a toolbar, but I want to use
specific icon images.

How do I set them in VBA ?
Is there a list of the icon ID's with their images I can select from ?
(again set in VBA)
Can I use external icon files ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Change toolbar icon in VBA

Hi,

If you want to use built in ones, you need to look at "FaceId" in help.
There are absolutely thousands of them... This will show them all, but it's
not fast.

Sub faces()

Dim i As Integer
Dim cont As CommandBarControl
Dim bar As CommandBar

On Error GoTo catcher

Application.ScreenUpdating = False
Set bar = CommandBars.Add(Position:=msoBarFloating, MenuBar:=False,
temporary:=True)
Set cont = bar.Controls.Add(Type:=msoControlButton, temporary:=True)

Do
cont.FaceId = i
cont.CopyFace
ActiveSheet.Paste Cells(i + 1, 1)
i = i + 1
Loop

catcher:
If Err.Number = 1004 Then Resume Next
bar.Delete

End Sub

you can set them in your code by declaring a commandbarcontrol and then
setting its faceid property.

Sam


"Paul" wrote:

I want to set a collection of icons into a toolbar, but I want to use
specific icon images.

How do I set them in VBA ?
Is there a list of the icon ID's with their images I can select from ?
(again set in VBA)
Can I use external icon files ?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change icon on quick access toolbar april Excel Discussion (Misc queries) 6 October 21st 09 08:49 PM
How do I add Icon to Toolbar? Adam.Effinger[_4_] Excel Programming 5 September 2nd 09 07:58 PM
toolbar or icon in a add-ins guedj54 Excel Programming 1 October 31st 06 01:06 PM
Icon in toolbar Nick Excel Programming 1 February 16th 04 11:57 AM
Add Icon to Toolbar SS[_3_] Excel Programming 1 January 16th 04 09:07 PM


All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"