Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Embed Image in Add-In

Can anyone give me some pointers on how to embed images in an Excel add-in so
that I can use them as ControlButton images?

I currently use bitmap images saved to the same folder as the add-in, but I
want to make the add-in more portable by embedding the images in the add-in
itself.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Embed Image in Add-In

Jim:

I hadn't heard of the ImageList control before now, but it looks like it may
be a suitable solution.

http://msdn.microsoft.com/library/de...istcontrol.asp

That's a link to the MSDN page on the ImageList control specifically
mentioning its use as a repository for icon images.

I'll keep you updated on my progress.

Thank you for your help.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Embed Image in Add-In

Various ways, store or images on other images controls, hidden on main form,
or on a dummy form like an ImageList, or worksheet controls on a sheet in
your addin

- Hidden images on your main form
Set Me.CommandButton11.Picture = Me.Controls("hidden_image1").Picture

- Dummy form used like an ImageList
Dim frm As UserForm
Set frm = UserForm2
Load frm
Set Label2.Picture = frm.Controls("Image1").Picture
' Set Label2.Picture = frm.Controls(1).Picture
' Set Label2.Picture = frm.Image1Picture
Unload frm

- Worksheet controls on a sheet in your addin
could set a ref to all oleObjects on the sheet

Dim mOles as Oleobjects ' at module level

in the Initialize event
Set mOles = thisworkbook.Worksheets(1).OleObjects

'where needed
Set Me.Label1.Picture = mOles("ole_name").Object.Picture

To remove a picture from your control
Set Me.Label.Picture = Nothing


Which of the above methods might depend on the number and total file sizes
of images, each have pros & cons, eg

Hidden controls on main form is simplest but could impact form load time

Dummy ImageList form is nice 'cos you can lay out all your images on the
dummy and tab between forms to look what you've got while developing.

Worksheet image controls - best for large number / file size but also fine
for small qty

Regards,
Peter T



"Lazzaroni" wrote in message
...
Can anyone give me some pointers on how to embed images in an Excel add-in

so
that I can use them as ControlButton images?

I currently use bitmap images saved to the same folder as the add-in, but

I
want to make the add-in more portable by embedding the images in the

add-in
itself.

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Embed Image in Add-In

Using a UserForm to store the images worked the easiest and best for me. As
Peter mentioned, you can arrange the images in the form for easy reference,
and if you use Labels instead of Image controls, you can actually label the
pictures easily as well. The best part is that the images are preloaded and
easy to refer to, especially if you take care to name the label to give some
indication of what image it contains.

Thanks so much for your help.
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
Embed image for mail merge smartgal Excel Discussion (Misc queries) 0 May 20th 10 07:50 PM
Embed object icon missing text and image CWilminko Excel Discussion (Misc queries) 0 March 5th 09 08:08 PM
how can I embed an image in a cell so it moves correctly during so Wilf Excel Discussion (Misc queries) 3 March 4th 07 02:43 PM
Embed image in cell sschroeder Excel Discussion (Misc queries) 7 August 9th 06 02:50 PM
How to embed an image withon a cell as opossed to copy and paste Karla Rodriguez Charts and Charting in Excel 3 November 4th 05 03:01 PM


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