title: Application.filesearch in Excel 2007 w/loop
body: <p>I've done several searches and I'm having trouble to find the right code when using the now non-existent .filesearch - I've looked into using both Dir and FileSystemObject but with nothing short of confusion when using a loop after the search... I'm hoping you might be able to help me come to an easier conclusion!</p>
  
  <p>In short, my current code searches a folder for all excel files, and opens the first, does what it needs to do with it, closes it, and opens the next searched file. Thanks in advance!</p>
  
  <pre><code>FilePath = "S:\My\File\Path"
  FileSpec = ".xls"
  
  Set FS = Application.FileSearch
      With FS
          .LookIn = FilePath
          .Filename = FileSpec
          .Execute
      End With
  
  For b = 1 To FS.FoundFiles.Count
      StrFile = FS.FoundFiles(b)
  
  Set mobjXL = New Excel.Application
  With mobjXL
  
      .Visible = False
  
  'REST OF CODE HERE
  
  next b
  </code></pre>