Find file with wild character : Application.FileSearch « Application « VBA / Excel / Access / Word






Find file with wild character

 
Sub findFile()
       Dim i As Integer
       With Application.FileSearch
            .NewSearch
            .LookIn = "c:\"
            .FileName = "*.mdb"
            .SearchSubFolders = True
                If .Execute() > 0 Then
                   For i = 1 To .FoundFiles.count
                     Debug.Print .FoundFiles(i)
                   Next i
                End If
        End With
End Sub

 








Related examples in the same category

1.Find files