Einzelnen Beitrag anzeigen

BrotherLui

Registriert seit: 14. Jun 2006
26 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: Meldung "Interface not supported" Woher?

  Alt 30. Jan 2007, 12:39
Danke für die Antwort.

Ich weiß leider nicht was du mit COM-Schnittstelle meinst. Ich zeige mal wie ich das mache.

So öffne ich Excel: (Das funktioniert noch)
Delphi-Quellcode:
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UMain, StdCtrls, ComCtrls,IniFiles,ExcelXP, ExtCtrls,Contnrs,Systeme,StrUtils,
  Menus;
...

form1.ExcelApplication1.Workbooks.Open(dateiname,EmptyParam, EmptyParam,
                               EmptyParam, EmptyParam, EmptyParam,
                               EmptyParam, EmptyParam, EmptyParam,
                               EmptyParam, EmptyParam, EmptyParam,
                               EmptyParam, EmptyParam, EmptyParam,lcid);
form1.ExcelWorkbook1.ConnectTo(form1.ExcelApplication1.Workbooks.Item[ExtractFileName(edit1.Text)]);
form1.ExcelWorksheet1.ConnectTo(form1.ExcelWorkbook1.Sheets.Item['Schnittstelle'] as _WorkSheet);
So greife ich auf die Dateien zu: (Hier kommt der Fehler)

Delphi-Quellcode:
uses Windows,Dialogs,SysUtils,Maus,ExcelXP,ComCtrls, Forms;
...

Excelapplication1.Workbooks.Item[1].Activate(GetUserDefaultLCID);
if ExcelWorksheet1.Range['B3', 'B3'].Value2 = 1 then
begin
  ExcelWorksheet1.Range['B3', 'B3'].Value2 := 0;
  ExcelWorksheet1.Range['B2', 'B2'].Value2 := aktzahl;
  ExcelApplication1.Run('makro1');
....
Und so sieht die Fehlermeldung aus: siehe Anhang
Miniaturansicht angehängter Grafiken
interface_165.gif  
  Mit Zitat antworten Zitat