My Delphi 6 program need to place an image on each row of my of Excel Sheet. I could insert a picture to a fixed position with something I read from another post.
procedure insertImages(ActiveSheet: OleVariant; ImageFilePath: String; ImageHeight, PictureTop, PictureLeft: Integer);
var
Picture: OleVariant;
begin
try
Picture := ActiveSheet.Pictures.Insert(ImageFilePath);
Picture.Width := ImageHeight * Picture.Width /Picture.Height;
Picture.Height := ImageHeight;
Picture.ShapeRange.Left := PictureLeft;
Picture.ShapeRange.Top := PictureTop;
Picture.Placement := xlMove;
except
end; //try
end; //insertImages;
The above code works fine, but I having trouble passing the PictureTop and PictureLeft parameter to make it so there is different image on the 2nd column of each row?
How can I get the Top and Left value for a specific cell? Or is there a better way to do this?
Please help.