Einzelnen Beitrag anzeigen

tylix

Registriert seit: 9. Dez 2003
Ort: Sauerlach
40 Beiträge
 
Delphi 5 Enterprise
 
#1

Erzeugte Exceldatei speichern

  Alt 8. Apr 2005, 13:41
Hallo,

ich erzeuge hiermit eine Exceldatei, dies funktioniert aber auch,
jedoch möchte ich diese erzeugte Datei automatisch speichern.

Ich finde leider nicht die richtige Lösung such schon seit ca. 1 Std. find´s aber nicht.

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  excel: TExcelApplication;
  SaveChanges: OleVariant;
  wb: _WorkBook;

  ws: _WorkSheet;

  a,zl,i, lcid: Integer;
  ze,sp:integer;
  z, y,x: string ;


begin
    lcid := GetUserDefaultLCID;
    excel := TExcelApplication.Create(self);
    excel.Connect;
    WB := Excel.Workbooks.Add(EmptyParam, LCID);;
    excel.Visible[lcid] := True;
    excel.Cells.Item[1, 1].Value := 'Ident';
    Excel.Cells.Item[1, 1].Interior.Color := clGreen;
    excel.Cells.Item[1, 2].Value := 'PR_ANREDE';
    Excel.Cells.Item[1, 2].Interior.Color := clGreen;
    excel.Cells.Item[1, 3].Value := 'PR_NAMEGES';
    Excel.Cells.Item[1, 3].Interior.Color := clGreen;
    excel.Cells.Item[1, 4].Value := 'PR_CO';
    Excel.Cells.Item[1, 4].Interior.Color := clGreen;
    excel.Cells.Item[1, 5].Value := 'Strasse';
    Excel.Cells.Item[1, 5].Interior.Color := clGreen;
    excel.Cells.Item[1, 6].Value := 'PLZ';
    Excel.Cells.Item[1, 6].Interior.Color := clGreen;
    excel.Cells.Item[1, 7].Value := 'ORT';
    Excel.Cells.Item[1, 7].Interior.Color := clGreen;
    excel.Cells.Item[1, 8].Value := 'Briefanr';
    Excel.Cells.Item[1, 8].Interior.Color := clGreen;
    excel.Cells.Item[1, 9].Value := 'Brief';
    Excel.Cells.Item[1, 9].Interior.Color := clGreen;

end;
Wäre super wenn ihr mir dabei helfen könntet.

Danke euch.
  Mit Zitat antworten Zitat