I've created an excel sheet with Delphi 6. Now I have to add a picture to my sheet. Anybody knows how to do that?
+3
A:
You could try it like this :
procedure InsertPicture(ActiveSheet: OleVariant; ImageFilePath: string: ImageHeight, PictureTop: Integer);
var
Picture: OleVariant;
begin
Picture := ActiveSheet.Pictures.Insert(ImageFilePath);
Picture.Width := ImageHeight * Picture.Width / Picture.Height;
Picture.Height := ImageHeight;
Picture.ShapeRange.Left := 0;
Picture.ShapeRange.Top := PictureTop;
Picture.Placement := xlMove;
end;
PatrickvL
2008-11-10 16:14:02
Exactly what I needed! Thanks.
Blue
2008-11-10 16:15:18