Displaying a linked Image in a spreadsheet

G

Glenn Mulno

Hi,

First - I apologize - I posted this earlier on public.excel - so this is a
cross post. I apologize if you subscribe to that list and this is a repeat.
Just trying to get a wider audience.

I am trying to have Excel show/display an image from a file and be able to
update/refresh that image if it changed but am not having any luck. The
image file will get updated weekly - so I am not looking to embed an image
one time. I want it to link to the source file and when I update the image
file, it will reflect the new image in Excel the next time Excel opens.

Inserting an image file embeds the image but there is no link to the source
file for updates.

I tried using the image control - but that did not appear to work right. It
did display the image, and I can resize the image to proper form - but the
image does not update the next time I open Excel after replacing the image.
There is a property of the image control called "AutoLoad" - but after I set
it to True - when I close and then reopen Excel - the image does not refresh
and that property is somehow reset to False.

At the moment - I am getting images sent to me in .png format - if the
solution could handle that it would be great. The steps I tried above I
tried with a converted jpg image and that did not work. The png image file
seems even less friendly.

I am using MS Office 2007 and the file is a .xlsm (macro enabled) file.

Thanks for any help you can provide.
 
D

Dave Peterson

I would record a macro when I deleted the existing picture and inserted (and
positioned) the replacement picture.

Then rename this macro to Auto_Open. That means that the macro will run each
time excel opens (if the user is allowing macros to run).

If I were really industrious, I could keep track (on a hidden worksheet?) the
last modified date for the picture. Then check to see what the date is on that
file and then import the file.

Actually, I don't think I'd worry about that. I'd just import the picture file
each time the workbook opened.
 
E

EricG

Try using "Insert/Object..." instead of "Insert/Picture". When the dialog
box comes up, select the "Create From File" tab, and make sure to check the
"Link to File" box. After that, every time you reopen the Excel workbook,
you will get the message about whether or not to update links (which you can
change with "Tools/Options...").

I think you can also then use "Edit/Links..." to update the links manually,
and there is probably also some VBA routine you could place in the
Workbook_Open event to update the links. Lots of options.

HTH,

Eric
 
G

Glenn Mulno

Thanks Eric,

I tried this option but it does not appear to be working as hoped. I get an
image block on the excel sheet - but it does not display the image - it
displays the file name of the image. If I double click on the image block -
it will open it in a MS picture viewer tool.

I am trying to create a dashboard that has everything displayed. This image
comes from an externally calculated tool as it is doing a distribution
series that Excel can't graph.
 
G

Glenn Mulno

Thanks Dave,

That would probably be an option I could use. I keep hoping for a more
direct programmatic way to do this. This feels like something that MS must
have thought of somewhere as I can't be the only person who wants to display
an image in Excel that gets updated when the source file is updated.

I will keep this as an option but will still seek another way.

Thanks for your help!
 
E

EricG

I did it in Excel 2003 and it worked fine. I don't have 2007. There may be
an option in that version that says "Don't display linked images" or
something like that. Look under "Tools/Options..." to see if you have some
checkbox ticked that won't display the image.

Eric
 
G

Glenn Mulno

That would make sense. I did look through the Excel options but did not
seem to find anything that effects this. I changed some items under the
"Trust Center" - but non that worked. I will see if I can find a machine in
our lab that has an older version of Excel to try it on.

Thanks again!
 
G

Glenn Mulno

Well - this turned out to be embarrassingly simple.

I was on the right track earlier by doing an insert picture and selecting
insert and link. That was good. What I did not do is close Excel
completely - not just the worksheet - the whole darn Excel app. That is
what causes it to refresh the link, not just reopening the book.

Thanks all for your help in this.
 

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

Top