Existence de l'installation de Excel sur une poste

sun59199 Messages postés 10 Date d'inscription samedi 12 juillet 2003 Statut Membre Dernière intervention 5 mai 2010 - 7 mai 2008 à 09:28
Mike Gagnon Messages postés 381 Date d'inscription vendredi 15 octobre 2004 Statut Membre Dernière intervention 24 octobre 2013 - 7 mai 2008 à 16:26
vanessa

1 réponse

Mike Gagnon Messages postés 381 Date d'inscription vendredi 15 octobre 2004 Statut Membre Dernière intervention 24 octobre 2013 2
7 mai 2008 à 16:26
Crée un fichier Excel temporaire et utilise ceci. La fonction va meme te montrer ou se trouve Excel

DECLARE INTEGER FindExecutable IN shell32;
STRING lpFile, STRING lpDir, STRING @lpResult

lcResult = SPACE(250)
STRTOFILE("test","c:\daily.xls")
IF FindExecutable ("c:\daily.xls", "", @lcResult) > 32
lcResult = ALLTRIM(STRTRAN(lcResult, Chr(0), " "))
? lcResult
ELSE
* 2 = ERROR_FILE_NOT_FOUND
* 3 = ERROR_PATH_NOT_FOUND
* 21 = ERROR_NOT_READY
* 127 = ERROR_PROC_NOT_FOUND
* 1008 = ERROR_NO_TOKEN

DECLARE INTEGER GetLastError IN kernel32
? "Error code:", GetLastError()
ENDIF
DELETE FILE c:\daily.xls
0
Rejoignez-nous