使用Delphi 6将图片添加到Excel表格中

我用Delphi 6创build了一个excel表格。现在我必须添加一张图片到我的表格中。 任何人都知道如何做到这一点?

你可以尝试这样的:

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;