Utiliser WSH pour acceder à la base de registre

cs_pitchoo Messages postés 6 Date d'inscription vendredi 17 janvier 2003 Statut Membre Dernière intervention 29 janvier 2003 - 24 janv. 2003 à 12:08
Defla Messages postés 5 Date d'inscription lundi 9 juin 2003 Statut Membre Dernière intervention 21 juillet 2003 - 27 juin 2003 à 15:59
Je souhaite vérifier si excel est installé sur la machine en testant une clé, or ce test ne marche pas il me renvoi l'erreur 424 "un objet est requis "

Dim acces_shell
Dim cle As String
-> Set acces_shell = wscript.CreateObject("Wscript.Shell")
cle = acces_shell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Excel\InstallRoot")
MsgBox "Cle = " & cle

Faut il installer ajouter une reference au projet?

merci de votre aide

1 réponse

Defla Messages postés 5 Date d'inscription lundi 9 juin 2003 Statut Membre Dernière intervention 21 juillet 2003
27 juin 2003 à 15:59
Kikoo,

Moi g mis ca et ca marche :

Dim acces_shell
Dim cle As String
Set acces_shell = CreateObject("Wscript.Shell")
cle = acces_shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Excel\InstallRoot\path")
MsgBox "Cle = " & cle

++
0
Rejoignez-nous