Mega Code Archive

 
Categories / VisualBasic Script / File Path
 

File files with Application FileSearch

Option Compare Database Option Explicit Sub findFile()    With Application.FileSearch       .NewSearch       .LookIn = "c:\VBA"       .FileName = "mydb.mdb"       .SearchSubFolders = True       If .Execute() > 0 Then          Debug.Print  .FoundFiles(1) & " was found"       Else          Debug.Print "The file is not found."       End If    End With End Sub