ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Embedding Images in Excel Workbook (https://www.excelbanter.com/excel-programming/330782-embedding-images-excel-workbook.html)

[email protected]

Embedding Images in Excel Workbook
 
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


Lee Hunter

Embedding Images in Excel Workbook
 
Hi Dan,

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


Lee Hunter

" wrote:

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




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

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