title: Search through folder / files with excel vba
body: <p>The goal is to create a macro, that takes whatever input string and searches the specified directory, and the files in that directory for that string. Absolute requirement is, that not only the file names are checked but also the content of the files. Output should be a list of the results. What i've got so far is a macro that looks like this:</p>
  
  <pre><code>Sub Test()
  
      Dim d As String
      Dim searchpath As String
      Dim searchlocation As String
  
      Cancel = True
      d = Selection.Value
  
      'change window name to make sure new explorer window is opened for each instance
      'copy string from manual search
  
      searchpath = "search-ms:displayname=" &amp; d &amp; "%20Results%20&amp;crumb=System.Generic.String%3A"
  
      searchlocation = "&amp;crumb=location:C%3A%5CUsers%5Csturm%5COneDrive%5CVigiles Capital GmbH%5C01 Vigiles Capital GmbH Team%5C09 Consulting%5C01 SRW%5C01 Peergroup Vergleich%5C05 SR am Westpark%5CDaten%5CZusatz 1"
          If Not d = "" Then
              Call Shell("explorer.exe """ &amp; searchpath &amp; d &amp; searchlocation &amp; "", 1)
          End If
  
  End Sub
  </code></pre>
  
  <p>This opens the windows explorer with the results of my search.
  What i need now is to put the results i get from this operation into a list, and then close the window again.</p>
  
  <p>Absolute world class would be a solution, which doesnt even require the call shell, i.e. the same operation without opening the explorer window.</p>
  
  <p>If its possible, how can i make it work?</p>