Thema: Delphi Probleme mit Excel2007

Einzelnen Beitrag anzeigen

hermidelphi

Registriert seit: 27. Nov 2003
51 Beiträge
 
Delphi 7 Personal
 
#1

Probleme mit Excel2007

  Alt 25. Jul 2007, 06:39
Hallo

Ich habe folgendes Problem:

In meiner Anwendung erzeuge ich eine Excel-Datei, läuft ohne Probleme mit Excel2003.
bei Excel2007 erscheint folgender Fehlercode. OLE-Fehler 800A03FC.

Delphi-Quellcode:
// Excel Applicationsfile erzeugen
DateiKopieren('empty.xls',GetCurrentDir + '\Arbeitszeit\Arbeitszeit_' + DateToStr(Datum.DateTime) + '.xls');

// Excel Application starten und Exceldokument oeffnen
ExcelApplication1.Connect;
ExcelApplication1.Visible[GetUserDefaultLCID] := true;
ExcelApplication1.UserControl := True;
ExcelApplication1.Workbooks.Open(GetCurrentDir + '\Arbeitszeit\Arbeitszeit_' + DateToStr(Datum.DateTime) + '.xls', False, False, EmptyParam, '', False, False, EmptyParam, EmptyParam, false, false, EmptyParam, EmptyParam, EmptyParam, false, 0);

// Workbook verbinden
ExcelWorkbook1.ConnectTo(ExcelApplication1.ActiveWorkBook);

// Workbookeigenschaften einstellen
ExcelWorkbook1.Title[1] := 'Arbeitszeiterfassung ' + datetimetostr(now);
ExcelWorkbook1.Author[1] := 'automatisch generiert';
ExcelWorkbook1.Save;

// Worksheet verbinden und aktivieren
ExcelWorksheet1.ConnectTo(ExcelWorkbook1.Sheets.Item[1] as _Worksheet);
ExcelWorksheet1.Activate;
Was mache ich falsch?

mfg
hermidelphi
  Mit Zitat antworten Zitat