急!!ole中Excel无法保存??,
ExcelApplication1.ActiveWorkBook.SaveAs(Filename := SaveDialog1.FileName,
                      FileFormat:=xlNormal,
                      Password := '',
                      WriteResPassword := '',
                      ReadOnlyRecommended := False,
                      CreateBackup := False); 
和ExcelWorkbook1.SaveAs(SaveDialog1.FileName)都不行。

解决方案 »

  1.   

    ExcelApplication1.Save('c:\ksaiy.xls')打开以后用这个保存。。
      

  2.   

    ole: 
      ExcelApp.SaveAs( 'C:\Excel\Demo1.xls' );Control:
     ExcelApplication1.SaveAs( 'C:\Excel\Demo1.xls' );
      

  3.   

    http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=29495
      

  4.   

    看了看。如果要直接保存的话直接用我给你的就行了。感觉用OLE更好使一点。
      

  5.   

    我用ExcelApplication1.Save('c:\ksaiy.xls');怎么出现保存提示对话框,我输入文件名保存,c:\ksaiy.xls 里面是空的。文件保存在我输入的文件名里面。为何c:\ksaiy.xls 里面是空的呢?我不想让他出现保存提示对话框要怎样做呢?
      

  6.   

    To(ari-爱的眼睛) :ExcelApp和 ExcelApplication1没有Saveas属性
      

  7.   

    那看看
    ExcelApplication1.ActiveWorkBook
      

  8.   

    ExcelApplication1.ActiveWorkBook到是有SaveAs,但还是确参数
      

  9.   

    可以了。这样:
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs,Comobj,Excel2000, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      ExcelApp:Variant;  implementation{$R *.dfm}
    procedure TForm1.Button1Click(Sender: TObject);
    var
      chexingshu:integer;
      Excelx1:string;
      Excelx2:string;
      xl,Cell1: olevariant;
      Sum:integer;
    begin
            ExcelApp := CreateOleObject( 'Excel.Application' );
            ExcelApp.Caption := '昆明理工大学学生素质综合测评表打印';
            ExcelApp.WorkBooks.Add;
            ExcelApp.WorkSheets[1].Activate;
                ExcelApp.Visible := True;
                ExcelApp.ActiveWindow.Zoom := 75;
           chexingshu:=24;
            excelx2:='a1';
            ExcelApp.Cells[1,1].Value :='昆明理工大学学生素质综合测评表';
            ExcelApp.cells.Item[1, 1].font.size := 26;
            ExcelApp.cells.Item[1, 1].RowHeight := 50;
            ExcelApp.cells.Item[1 , 1].Font.Bold := True;
            ExcelApp.cells.Item[1, 1].HorizontalAlignment := xlCenter;
            ExcelApp.cells.Item[1, 1].font.Name := '黑体';
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
      ExcelApp.ActiveWorkbook.SaveAs('c:\1k1.xls');
    end;end.