Delphi 6 プログラムでは、Excel シートの各行に画像を配置する必要があります。別の投稿から読んだもので、写真を固定位置に挿入できました。
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;
上記のコードは正常に動作しますが、PictureTop および PictureLeft パラメータを渡して各行の 2 列目に異なる画像を表示するのに問題がありますか?
特定のセルの上と左の値を取得するにはどうすればよいですか? または、これを行うより良い方法はありますか?
助けてください。