Bonjour,
J'aurais besoin de votre aide pour finaliser ma macro.
Je m'explique j'ai un fichier batch dans certains nombres de mes dossiers que j'aimerais exécuter avec un bouton
bien entendu j'ai plusieurs dossiers dont je parcours avec une boucle et la commande shell pour lancer mon batch
au lancement de ma macro j'ai erreur exécution 5 au niveau de la commande shell après recherche j'arrive pas a trouver la solution
ci -joint ma macro
Sub Facturation()
Application.ScreenUpdating = False
Dim aa As Object
Dim myPath As String, myFolder As String, mainFolder As Folder, batFile As String
Set aa = CreateObject("scripting.filesystemobject")
myPath = "R:\DEVIS\SUIVI COMMANDES ET DEVIS\"
ChDir (myPath)
ChDir ("..")
myFolder = CurDir(myPath)
myFolder = Dir(myPath & "\", vbDirectory)
batFile = Dir(myPath & "\TestMiguelV3.bat")
Set mainFolder = aa.GetFolder(myFolder)
Do While myFolder <> ""
If GetAttr(myPath & "\" & batFile) = vbDirectory Then
Shell batFile
End If
myFolder = Dir()
Loop
Set aa = Nothing
Set mainFolder = Nothing
End Sub
Cordialement,
Adjovi
J'aurais besoin de votre aide pour finaliser ma macro.
Je m'explique j'ai un fichier batch dans certains nombres de mes dossiers que j'aimerais exécuter avec un bouton
bien entendu j'ai plusieurs dossiers dont je parcours avec une boucle et la commande shell pour lancer mon batch
au lancement de ma macro j'ai erreur exécution 5 au niveau de la commande shell après recherche j'arrive pas a trouver la solution
ci -joint ma macro
Sub Facturation()
Application.ScreenUpdating = False
Dim aa As Object
Dim myPath As String, myFolder As String, mainFolder As Folder, batFile As String
Set aa = CreateObject("scripting.filesystemobject")
myPath = "R:\DEVIS\SUIVI COMMANDES ET DEVIS\"
ChDir (myPath)
ChDir ("..")
myFolder = CurDir(myPath)
myFolder = Dir(myPath & "\", vbDirectory)
batFile = Dir(myPath & "\TestMiguelV3.bat")
Set mainFolder = aa.GetFolder(myFolder)
Do While myFolder <> ""
If GetAttr(myPath & "\" & batFile) = vbDirectory Then
Shell batFile
End If
myFolder = Dir()
Loop
Set aa = Nothing
Set mainFolder = Nothing
End Sub
Cordialement,
Adjovi