lancer une commande dos en shell
bonjour forum
je bute depuis un momment pour lancer un fichier de commande dos depuis vba
j' ai essayé ça :
Code:
1 2 3 4 5 6 7
|
Sub maj_IVM()
com_dos = ThisWorkbook.Path & "\Rep_IVM.cmd"
S = ThisWorkbook.Path & "\Rep_IVM.txt"
com_dos = "COMMAND.COM /C " & com_dos
Shell "cmd.exe /c " & com_dos
End Sub |
Rep_IVM.cmd contient :
dir S:\ORG_CIS_IVM /s >Rep_IVM.txt
ce code ne veut pas se lancer
j' aimerai essayer
Code:
1 2 3 4 5 6 7 8
|
Sub try1()
com_dos = ThisWorkbook.Path & "\Rep_IVM.cmd"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run com_dos, SH_WIDE
End Sub |
mais la compilation plante :
"object required"
peut être y a t il une librairie qu'il faille activer avant
mais laquelle ?