Thema: Delphi DElphi<>Excel ??

Einzelnen Beitrag anzeigen

Vader

Registriert seit: 6. Mai 2003
804 Beiträge
 
Delphi 6 Enterprise
 
#5

Re: DElphi<>Excel ??

  Alt 19. Jun 2005, 09:05
hallo,

das vorherige problem hab ich schon gelöst, aber es gibt ein neues
und zwar wenn ich diese exceldatei öffnen will c:\test.xls kommt die fehlermeldung:


kann diese datei nicht finden, überprüfen sie die rechtschreibung und speicherort


Delphi-Quellcode:
procedure TForm1.btnOpenFileClick(Sender: TObject);
var
  FExcelFilename : OleVariant;
begin
  FExcelFilename:=ExtractFilePath(ParamStr(0))+'c:\test.xls';
  ExcelApplication.Workbooks.Open(FExcelFilename,EmptyParam,EmptyParam,EmptyParam,
                                  EmptyParam,EmptyParam,EmptyParam,EmptyParam,
                                  EmptyParam,EmptyParam,EmptyParam,EmptyParam,
                                  EmptyParam,FLCID);
  ExcelWorkbook.ConnectTo(ExcelApplication.Workbooks.Item['c:\test.xls']);
  ExcelWorksheet.ConnectTo(ExcelWorkbook.Sheets.Item['Tabelle1'] as _WorkSheet);

  btnReadCell.Enabled:=True;
end;
mfg
  Mit Zitat antworten Zitat