Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi OLE: Schnittstelle wird nicht unterstützt (https://www.delphipraxis.net/85277-ole-schnittstelle-wird-nicht-unterstuetzt.html)

hermannhass 28. Jan 2007 14:23


OLE: Schnittstelle wird nicht unterstützt
 
Ich lese aus einer Exceldatei eine Tabelle und kopiere Sie in ein Stringgrid.
Ich connectiere Excel:
ExcelApplication1:=TExcelApplication.create(nil);
FLCID:=GetUserDefaultLCID;
ExcelApplication1.Visible[FLCID] := False; // Starte Excel unsichtbar
ExcelApplication1.UserControl:= False; // UserControl muss immer syschron zu Visible gesetzt
ExcelApplication1.DisplayAlerts[FLCID]:=False; // Unterdrücke alle Fehlermeldungen von Excel
ExcelApplication1.Connect;
....
führe meine "operationen" durch
....
und disconnectiere ordnungsgemäß
ExcelApplication1.Quit;
ExcelApplication1.Disconnect; (*)
ExcelApplication1.free;


Dies klappt wunderbar. Wenn ich aber diese Procedure mehrmals hintereinander aufrufe, kommt beim2,3 oder 4. mal(unterschiedlich) eine Exception "Schnittstelle wird nicht unterstützt" an der Stelle (*)
Auch Befehle wie Processmessages oder handlemessage bringen nichts.
Es schein trotzdem ein Synchronisationspüroblem zu sein.

Habt Ihr einen Tip? Danke

hermannhass 28. Jan 2007 16:15

Re: OLE: Schnittstelle wird nicht unterstützt
 
Schon gefunden!!!
Hatte ein Close vergessen, ich dachte, das würde das Quit automatisch machen!


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:03 Uhr.

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