如何用delphi中excelapplication ,excelbook,excelsheet打开已存在的excel文档

解决方案 »

  1.   

    foilsman非常感谢你,但我对这种用法不太熟悉 ,请写的具体一点 .谢谢!
      

  2.   

    var
     ExcelApp: OleVariant;
     ExcelSheet: OleVariant;ExcelApp := CreateOleObject('Excel.Application');
    ExcelApp.Caption := '测试';
    ExcelApp.WorkBooks.Add;
    ExcelSheet := ExcelApp.WorkSheets[1];
    ExcelSheet.Name := '第一页';
    ExcelApp.Visible := true;//WorkBook对象一般用不着.
      

  3.   

    注意要uses Comobj;var
     xlApp: OleVariant;
    begin
     xlApp := CreateOleObject('Excel.Application');
     xlApp.WorkBooks.Open('C:\book1.xls');
     xlApp.Visible := true;
    end;