Salut Exploreur ;)
Merci pour mon code Hélas, WMI est gourmand en ressource. Pour ce qu'il souhaite, je lui conseille mon Snippet
Sub Cherche_Fichiers_Dans_Dossier()
Dim strMessage As String
Dim i As Long
Set fs = Application.FileSearch
With fs
.LookIn = "C:" ' *** mettre ici le dossier voulu !
.SearchSubFolders = True
.Filename = "*.exe" ' *** extension à
modifier
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "Il y a " & .FoundFiles.Count & _
" fichier(s) trouvé(s)."
For i = 1 To .FoundFiles.Count
Cells(i, 1).Value = .FoundFiles(i)
'
*** attention à la localisation. Modifie au besoin
Next i
Else
MsgBox "Il n'y a aucun fichier."
End If
End With
End Sub
~
<small>[code.aspx?ID=39466 Mortalino] ~
Colorisation automatique</small>
Bonne journée à tous
@++
<hr size="2" width="100%" />
--Mortalino--
Le mystérieux chevalier, ~Provençal, le Gaulois~