Setting Custom Icons at Run-time

  • Thread starter Thread starter DNF Karran
  • Start date Start date
D

DNF Karran

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
 
Syed,

It doesn't really matter what file type they are as you will load them into
the Excel sheet (Insert>Picture>From 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 said:
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


in message
 
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,
 
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 said:
Syed,

It doesn't really matter what file type they are as you will load them into
the Excel sheet (Insert>Picture>From 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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top