想调用ExcelApplication,往里面写字符可以,但如何写图片?
Sheet.Cell[1,1].value:=image1.picture;
???????????????????

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      aWorkBook : _Workbook;
      aSheet : Variant;
    begin
      if OpenPictureDialog1.Execute then
      begin
        ExcelApplication1.Connect;
        aWorkBook := ExcelApplication1.Workbooks.Add(EmptyParam, 0);
        aSheet := aWorkBook.Sheets[1];
        aSheet.Range['f1'].Select;//这里是定位图片插入的位置
        asheet.Pictures.Insert(OpenPictureDialog1.FileName);
        ExcelApplication1.Visible[0] := True;
        ExcelApplication1.Disconnect;
      end;
    end; 你参看一下
      

  2.   

    Xl.ActiveSheet.Pictures.Insert['C:\2.jpg'].Select;
      

  3.   

    可不可以插入Delphi程序里Image对象的图片呢?
    不想从文件插入!
    谢谢!