Find files : Application.FileSearch « Application « VBA / Excel / Access / Word






Find files

 
Sub findFile()
   With Application.FileSearch
        .NewSearch
        .LookIn = "c:\BegVBA"
        .FileName = "store.mdb"
        .SearchSubFolders = True
            If .Execute() > 0 Then
               msgBox "The file " & .FoundFiles(1) & " was found"
             Else
                msgBox "The file is not found"
            End If
    End With
End Sub

 








Related examples in the same category

1.Find file with wild character