ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting Custom Icons at Run-time (https://www.excelbanter.com/excel-programming/299043-setting-custom-icons-run-time.html)

DNF Karran[_12_]

Setting Custom Icons at Run-time
 
You cannot edit them as you would manually but you can save your image
as pictures in your workbook, perhaps on hidden
sheets, then do copy and pasteface when you create your menus wit
code.

Dunca

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


Bob Phillips[_6_]

Setting Custom Icons at Run-time
 
Syed,

It doesn't really matter what file type they are as you will load them into
the Excel sheet (InsertPictureFrom File), and name them. To add them to
the toolbar, use

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.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Syed Zeeshan Haider" wrote in message
...
Thanks, Duncan!

I like the idea of saving images on hidden sheets. But what should be the
format of these images *.bmp, *.ico, *.gif or what?
And how would I copy an image from a sheet?

Thank you,
--
Syed Zeeshan Haider



--------------------------------------------------
http://szh.20m.com
http://gomusharrafgo.20m.com


"DNF Karran " wrote in message
...
You cannot edit them as you would manually but you can save your images
as pictures in your workbook, perhaps on hidden
sheets, then do copy and pasteface when you create your menus with
code.

Duncan


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






Syed Zeeshan Haider[_7_]

Setting Custom Icons at Run-time
 
Hello Experts,
I have Excel 97 Pro on Win98SE.

If there is a custom toolbar in Excel with some buttons, then is it possible
to set them custom icons programmatically?

I have searched through the Excel Help but all in vain.

Thank you,
--
Syed Zeeshan Haider



--------------------------------------------------
http://szh.20m.com
http://gomusharrafgo.20m.com





Syed Zeeshan Haider[_7_]

Setting Custom Icons at Run-time
 
Thanks, Duncan!

I like the idea of saving images on hidden sheets. But what should be the
format of these images *.bmp, *.ico, *.gif or what?
And how would I copy an image from a sheet?

Thank you,
--
Syed Zeeshan Haider



--------------------------------------------------
http://szh.20m.com
http://gomusharrafgo.20m.com


"DNF Karran " wrote in message
...
You cannot edit them as you would manually but you can save your images
as pictures in your workbook, perhaps on hidden
sheets, then do copy and pasteface when you create your menus with
code.

Duncan


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




Syed Zeeshan Haider[_7_]

Setting Custom Icons at Run-time
 
Thanks, Bob!

Now I am starting my project again. I hope I'll succeed.

Thanks again!
--
Syed Zeeshan Haider



--------------------------------------------------
http://szh.20m.com
http://gomusharrafgo.20m.com


"Bob Phillips" wrote in message
...
Syed,

It doesn't really matter what file type they are as you will load them

into
the Excel sheet (InsertPictureFrom File), and name them. To add them to
the toolbar, use

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.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Syed Zeeshan Haider" wrote in message
...
Thanks, Duncan!

I like the idea of saving images on hidden sheets. But what should be

the
format of these images *.bmp, *.ico, *.gif or what?
And how would I copy an image from a sheet?

Thank you,
--
Syed Zeeshan Haider



--------------------------------------------------
http://szh.20m.com
http://gomusharrafgo.20m.com


"DNF Karran " wrote in message
...
You cannot edit them as you would manually but you can save your

images
as pictures in your workbook, perhaps on hidden
sheets, then do copy and pasteface when you create your menus with
code.

Duncan


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









All times are GMT +1. The time now is 07:32 PM.

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