Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I would like to embed and image into an excel spreadsheet using .vbs

Status
Not open for further replies.

jloyzaga

Programmer
Feb 26, 2003
4
AU

I would like to embed an image into an excel spreadsheet via code. the image is "C:/image.png" and I want to embed it into sheet1:cell:a1:a1
I can put a hyperlink by using this code

oEngine.ActiveSheet.Hyperlinks.Add objSheet.Cells(Row, 6), "", screenshotname, screenshotname


But I'd like to actually have the image in the cell- can anybody help?
Thanks
Joe
 

hi,
But I'd like to actually have the image in the cell
The Shapes collection, is part of the Sheet object, not the Range object, which is where a Cell is.

Use your macro recorder to add a shape (image) to the sheet and then position/size the shape to appear to be in the desired cell, using the cells, top, left, width, height properties.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top