Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Wie kann ich daten aus excel auslese (https://www.delphipraxis.net/5719-wie-kann-ich-daten-aus-excel-auslese.html)

bundy 16. Jun 2003 17:30


Wie kann ich daten aus excel auslese
 
:dancer2: Hallo wie kann ich daten aus excel auslese. :dancer2:
Ich habe im Forum schon geschaut aber ich konnte damit nichts anfangen.
Habe folgenden Code:

Bekomme aber immer Fehlermeldung OLE Error:

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

  btnReadCell.Enabled:=True;
end;


was mache ich falsch ???

[edit=MrSpock]schließendes Code Tag eingefügt[/edit]

Duffy 16. Jun 2003 17:35

Hallo bundy,
http://www.delphipraxis.net/viewtopi...218&highlight=
bye

bundy 16. Jun 2003 17:44

Und wie funzt die Componente ?

Duffy 16. Jun 2003 17:48

Hallo bundy,
installiere die Komponente und schau in den Quelltesxt. Der ist ziemlich selbsterklärend.
bye

Uncle Cracker 16. Jun 2003 18:02

Kannst dir auch mal das Programm aus diesem Thread angucken:

http://www.delphipraxis.net/viewtopi...062&highlight=

bundy 17. Jun 2003 08:40

[Error] Unit1.pas(93): Undeclared identifier: 'Range'
[Error] Unit1.pas(104): Undeclared identifier: 'EmptyParam'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'



Diese Fehlermeldungen bekomme ich !

Jens Schumann 17. Jun 2003 08:46

Hallo bundy,
Zitat:

[Error] Unit1.pas(93): Undeclared identifier: 'Range'
Unit excel2000.pas zum Projekt hinzufügen und mit in die uses Anweisung aufnehmen
Zitat:

[Error] Unit1.pas(104): Undeclared identifier: 'EmptyParam'
Unit Variants in die uses Anweisung mit aufnehmen.

bundy 18. Jun 2003 09:46

HY danke es funzt.
Die Componente funzt einwandfrei.


:bounce2: Danke :bounce2: DAnke :bounce2: Danke :bounce2: Danke :bounce2:


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:00 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz