Autor Beitrag
rob87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Di 22.01.08 09:46 
Hallo, ich fang grad an, mich mit der Schnittstelle Delphi <-> Excel zu beschäftigen

Nun hab ich schon in Erfahrung gebracht, dass manche ein einfaches OLE-Objekt anlegen und dieses dann bearbeiten. Also bsw. so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Excel := CreateOleObject('Excel.Application');
Excel.Visible := false;
Excel.Workbooks.Open(filename := 'testdatei1.xls');
//...


Andere machen es so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
flcid := GetUserDefaultLCID;
ExcelApplication1.Connect;
ExcelApplication1.Visible[flcid] := true;
ExcelApplication1.UserControl:=true;
und brauchen dabei kein OLE-Object anlegen

Nun bin ich doch etwas verwirrt.

Hinzu kommt noch, dass wenn ich die erste Variante mache, ich nach einem Punkt keine automatischen Vorschläge bekomme, bei der unteren Variante aber schon. Wer kann mir helfen???

Auch event. mit einem unfangreichen Tutorial??
Genie
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 17

Win 95, 98, 2000, Millenium, XP, Linux, Unix

BeitragVerfasst: Di 22.01.08 11:13 
Wie wärs mal mit ADO
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Di 22.01.08 11:23 
ADO? ADO nutz ich bis jetzt nur zur Anbindung an eine Microsoft SQL-DB??

Aber nicht für Excel? Kann mir denn keiner bei meiner Frage weiterhelfen?
Genie
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 17

Win 95, 98, 2000, Millenium, XP, Linux, Unix

BeitragVerfasst: Di 22.01.08 11:30 
ADO ist weitaus mächtiger als du denkst.
Auch Excel kannst du mit ADO bearbeiten.
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Di 22.01.08 11:50 
Mir wärs trotzdem lieber des so zu machen. Hier hab ich nämlich zum Einen schon paar kurze Tutorial-Ausschnitte gefunden und zum Anderen wär des meinem Chef auch lieber.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 22.01.08 12:14 
Zitat:
und brauchen dabei kein OLE-Object anlegen

das macht der Wrapper für dich
www.delphi-treff.de/...-office/katalog/218/

_________________
Markus Kinzler.
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Di 22.01.08 12:54 
Des Tutorial kenn ich. Aber da steht auch nix von ADO, sondern auch des was ich in meinem Quellcode ganz oben schon bissal drinhab.

Des is ned ADO, oder?
Genie
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 17

Win 95, 98, 2000, Millenium, XP, Linux, Unix

BeitragVerfasst: Di 22.01.08 13:33 
Nein ist es nicht...ADO ist wenn ADO drauf steht ;-)
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Di 22.01.08 13:34 
Na eben.

Aber dieses Tutorial verwirrt mich bloß. Ich wollt nur nochmal auf meinen ersten Beitrag hindeuten. Ich versteh des einfach ned.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 22.01.08 14:56 
Wie geschrieben, ist das zweitere ein Wrapper um die COM-Objekte, welcher statisch ins Programm gelinkt wird. Beim 1. Beispiel wird dynamisch eine Verbindung zum einem COM-Objekt aufgebaut. deshalb ist natürlich dessen Eigenschaften beim Compilieren noch nicht bekannt.

_________________
Markus Kinzler.
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Mi 23.01.08 10:33 
Jetzt is mir des Ganze schon klarer. Danke :wink:

Werd aber trotzdem eher des Statische nehmen.