Autor Beitrag
Christoph Englmann
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Di 19.07.05 11:00 
hallo,

hab in mein projekt die microsoft excel 8.0 library V1.2 eingebunden.

beim kompilieren erscheint aber die fehlermeldung
"undeclared identifier get_application"
bzw. danach noch viele mehr
undeclared identifier...

scheint so, als ob beim einbinden da was falsch gelaufen ist oder?
(hab auch schon von nem angeblichen D6 bug in dieser Richtung gehört)

Hilfe

danke
christoph
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Di 19.07.05 18:35 
warum kam mir das bloß so bekannt vor.

die Excel-lib alleine reicht nicht. gugg in der erzeugten unit in die beiden uses teile, da findest du weitere benötigte Units, z.B. VBIDE** (sollte die "Micosoft Visual Basic for Application Extensibilty sein"). Word und Office solltest du auch gleich mit importieren.

Wenn du eine D6-Version hast, frag ich mich aber, wo zu du das brauchst?

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Do 21.07.05 15:11 
hallo,

erstmal danke für die antwort...

bin jetzt schon ein bisschen weiter, allerdings erscheint nach dem Befehl ExcelApllication1.connectTO(....
die Fehlermeldung:
OLE error 8007DFF0
und das programm steigt aus der procedure aus...

hier der quellcode:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
procedure TFormAusgabe.cmdExportierenClick(Sender: TObject);


begin


//Excel starten
  flcid := GetUserDefaultLCID;
  ExcelApplication1.Connect;
  ExcelApplication1.Visible[flcid] := true;
  ExcelApplication1.UserControl := true;

//Arbeitsmappe erstellen und Verbindung herstellen
copyfile('C:\vt\LAPAS\Vorlagen\Mappe1.xls','C:\vt\LAPAS\temp\LSA_Stammdaten_Auszug.xls', false);


  ExcelWorkbook1.ConnectTo(ExcelApplication1.workbooks.open('C:\vt\LAPAS\temp\LSA_Stammdaten_Auszug.xls',
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam, flcid));

  ExcelWorksheet1.ConnectTo(ExcelWorkbook1.Sheets.item[1] as ExcelWorksheet);

  ExcelWorksheet1.Range['A1','A1'].Value := 'TEST';

Listview_Auslesen(ListviewAusgabe);


ExcelApplication1.quit;
ExcelApplication1.disconnect;

end;

(auf der Form sind je eine Komponente
ExcelApplication1
ExcelWorkbook1
ExcelWorksheet1
vorhanden


was meinst Du übrigens mit "wenn Du delphi6 benutzt verstehst Du net, warum ich das überhaupt brauche?"

mein ziel ist es einfach Daten aus einer listview heraus Daten in eine Excel Mappe zu schreiben...


danke
christoph
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Do 21.07.05 19:24 
Zitat:

was meinst Du übrigens mit "wenn Du delphi6 benutzt verstehst Du net, warum ich das überhaupt brauche?"

mein ziel ist es einfach Daten aus einer listview heraus Daten in eine Excel Mappe zu schreiben...


ich frage mich deshalb, warum du die tlb noch mal erstellst, da in delphi 6 das alles schon da ist (Reiter Server).

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Fr 22.07.05 08:30 
ja, aber wie gesagt erhalte ich immer noch die oben erwähnte fehlermeldung...
deswegen wollte ich tlb nochmals compilieren...
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 24.07.05 19:49 
hallo

probiers mal einzeln und Schritt für Schritt (Workbook öffnen, nicht gleich verbinden...).

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Christoph Englmann Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Mo 25.07.05 14:54 
erstmal danke für den tip...

habs mit folgendem Quellcode versucht:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
procedure TFormAusgabe.cmdExportierenClick(Sender: TObject);


begin


//Excel starten
  flcid := GetUserDefaultLCID;
  ExcelApplication1.Connect;
  ExcelApplication1.Visible[flcid] := true;
  ExcelApplication1.UserControl := true;

//Arbeitsmappe erstellen und Verbindung herstellen
copyfile('C:\vt\LAPAS\Vorlagen\Mappe1.xls','C:\vt\LAPAS\temp\LSA_Stammdaten_Auszug.xls', false);


  ExcelApplication1.workbooks.open('C:\vt\LAPAS\temp\LSA_Stammdaten_Auszug.xls',
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam,
    emptyParam, flcid);

  ExcelWorkbook1.ConnectTo(ExcelApplication1.activeworkbook);
  ExcelWorksheet1.ConnectTo(ExcelWorkbook1.Sheets.item[1] as ExcelWorksheet);

  ExcelWorksheet1.Range['A1','A1'].Value := 'TEST';

Listview_Auslesen(ListviewAusgabe);


ExcelApplication1.quit;
ExcelApplication1.disconnect;

end;



leider immer noch die fehlermeldung und zwar in der zeile
ExcelApplication1.workbooks.open('C:\vt\LAPAS\temp\LSA_Stammdaten_Auszug.xls',
...
..
(Die angegebene Datei wird allerdings noch geöffnet)

christoph
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mo 25.07.05 20:12 
dann nimm nochmal das copyfile raus und öffne eine Excel-datei, die bereits existiert und die noch nicht offen ist.
bei deinem code kanns zwar eigentlich nicht sein, aber vielleicht ist die Datei bereits geöffnet und excel will dir noch mitteilen, das du sie nur schreibgeschützt öffnen kannst.

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Poehlau
Hält's aus hier
Beiträge: 11



BeitragVerfasst: Fr 20.01.06 12:22 
Ich habe das gleiche Problem in Delphi7.
Gibt es mittlerweile eine Lösung dafür?

Danke.