Embedding Images in Excel Workbook

D

danmyhre

Hello,

I am dynamically creating excel workbooks by generating a htm file
inside of a VB app, then opening the htm file in excel, and then saving
the workbook in standard excel format (xls). The only problem I have
is that my images are saved as "Linked" instead of "Embedded" images.

Example HTM:
....
<td>
<img src="file:///\\myserver\share\image.jpg">
</td>
....

Since the image is linked, if the image file on the server where to be
moved or deleted, all of the workbooks that reference that image would
just contain a place holder.

Is there a way to go through all of the shape objects (images) in excel
and switch it from being a linked to embedded image so that it gets
saved inside of the xls file??

Thanks

Dan
 
G

Guest

Hi Dan,

try " =EMBED("Worksheet","") "ActiveSheet.OLEObjects.Add(Filename:= _
"YourFIleName" , Link:=False, DisplayAsIcon:=False).Select


Lee Hunter
 

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