Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mo 14.04.08 20:26 
Hi, Delpher,

kann ich mit der folgenden Funktion prüfen, ob Excel auf dem Rechner vorhanden ist - oder geht es einfacher - und wie ist dann der Aufruf im Code?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function Excel_vorhanden: boolean;
begin
  result := false;
  try
    excel := CreateOleObject('Excel.Application');
    result := true;
  except
    ShowMessage('Excel kann nicht gestartet werden!');
    Exit;
  end;
end;


Vielen Dank für Hilfe,
Detlef

_________________
ut vires desint, tamen est laudanda voluntas
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 15.04.08 20:17 
Hi,

ich habe den Code jetzt so geändert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
function Excel_vorhanden: boolean;  
begin  
  Excel_vorhanden := false;  
  try  
    excel := CreateOleObject('Excel.Application');  
    Excel_vorhanden := true;  
  except  
    ShowMessage('Excel kann nicht gestartet werden!');  
    Exit;  
  end;  
end

....
if Excel_vorhanden then
begin
  ...
end;


Ist das so okay?
(Bisher hatte ich ja noch keine Antwort ... :roll: :roll:
Gruß, Detlef

_________________
ut vires desint, tamen est laudanda voluntas
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 16.04.08 17:29 
es ist okay, Detlef

_________________
ut vires desint, tamen est laudanda voluntas