Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Toolbar Button

I want to load an icon image (.ico file) to a
CommandBarButton. How can I do this?

I know CommandBarButton has the method "PasteFace", but
this requires the image first copied onto the clipboard. I
don't think (can I?) I can load an .ico file directly to
clipboard.

Any solution?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Toolbar Button



--

HTH

Bob Phillips

"Gary Chan" wrote in message
...
I want to load an icon image (.ico file) to a
CommandBarButton. How can I do this?

I know CommandBarButton has the method "PasteFace", but
this requires the image first copied onto the clipboard. I
don't think (can I?) I can load an .ico file directly to
clipboard.

Any solution?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Toolbar Button

Gary,

In essence, you need to have the icons as an image somewhere and load the
shape. I do this by putting them on a hidden sheet on the workbook that the
commandbar is created from, with code somewhat like

cbTable.Shapes(shapename).CopyPicture
cbCtl.PasteFace

where cbTable is the codename of the sheet containing the picture, shapename
is the name of the shape, such as 'Picture 30', and cbCtl is an object
variable for the control being added.

If you want to use the builtin faceids, you would use something like

cbCtl.FaceId = faceIdNum


--

HTH

Bob Phillips

"Gary Chan" wrote in message
...
I want to load an icon image (.ico file) to a
CommandBarButton. How can I do this?

I know CommandBarButton has the method "PasteFace", but
this requires the image first copied onto the clipboard. I
don't think (can I?) I can load an .ico file directly to
clipboard.

Any solution?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Toolbar Button

Hi Gary,
See my page
http://www.mvps.org/dmcritchie/excel/toolbars.htm#ico
I redid the area after finding that there was a bad link so you
have at least one choice now.

to get the image to the clipboard such as for Excel toolbar use, this one works for me
Icon Sucker 2
http://www.copseystrain.com/iconsucker/index.

to create a file such as for documentation in HTML
IconXTractor 2.304,
http://home.tiscali.de/kurtzimmerman...xtractor_e.htm

With both of the above you have to go through the file directories,
you cannot directly paste the directory you want when you specify the file.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Gary Chan" wrote in message ...
Thank you for your reply.

but shape object doesn't seem to take .ico files but just
bmp files.

I have problem with bmp files because when I load a bmp
file (by converting from a ico file) to a commandbarbutton
the icon is blurred (probably this is a bug)


-----Original Message-----
Gary,

In essence, you need to have the icons as an image

somewhere and load the
shape. I do this by putting them on a hidden sheet on the

workbook that the
commandbar is created from, with code somewhat like

cbTable.Shapes(shapename).CopyPicture
cbCtl.PasteFace

where cbTable is the codename of the sheet containing the

picture, shapename
is the name of the shape, such as 'Picture 30', and cbCtl

is an object
variable for the control being added.

If you want to use the builtin faceids, you would use

something like

cbCtl.FaceId = faceIdNum


--

HTH

Bob Phillips

"Gary Chan" wrote in message
...
I want to load an icon image (.ico file) to a
CommandBarButton. How can I do this?

I know CommandBarButton has the method "PasteFace", but
this requires the image first copied onto the

clipboard. I
don't think (can I?) I can load an .ico file directly to
clipboard.

Any solution?



.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Toolbar Button

Bob,

Do you have a "loose trigger finger" or a problem with Outlook (no pun
intended). Many of your posts are preceded with a blank response...

--
sb
"Bob Phillips" wrote in message
...


--

HTH

Bob Phillips

"Gary Chan" wrote in message
...
I want to load an icon image (.ico file) to a
CommandBarButton. How can I do this?

I know CommandBarButton has the method "PasteFace", but
this requires the image first copied onto the clipboard. I
don't think (can I?) I can load an .ico file directly to
clipboard.

Any solution?





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
toolbar button Dennis S. Excel Discussion (Misc queries) 5 July 9th 08 03:52 AM
Toolbar button fda secretary Excel Discussion (Misc queries) 1 October 22nd 07 09:41 PM
Button with macro in toolbar Daniel Charts and Charting in Excel 1 August 25th 07 02:39 AM
New button on toolbar attaboy Excel Worksheet Functions 5 January 23rd 07 04:17 PM
Sum Button Toolbar Rugdoody Excel Discussion (Misc queries) 3 May 20th 06 12:38 AM


All times are GMT +1. The time now is 09:35 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"