title: Get list of Excel files in a folder using VBA
body: <p>I need to get the names of all the Excel files in a folder and then make changes to each file. I've gotten the "make changes" part sorted out. Is there a way to get a list of the <code>.xlsx</code> files in one folder, say <code>D:\Personal</code> and store it in a String Array.</p>
  
  <p>I then need to iterate through the list of files and run a macro on each of the files which I figured I can do using:</p>
  
  <pre><code>Filepath = "D:\Personal\"
  For Each i in FileArray
      Workbooks.Open(Filepath+i)
  Next
  </code></pre>
  
  <p>I had a look at <a href="https://stackoverflow.com/questions/10380312/loop-through-files-in-a-folder-using-vba">this</a>, however, I wasn't able to open the files cause it stored the names in <code>Variant</code> format.</p>
  
  <p>In short, how can I use VBA to get a list of Excel filenames in a specific folder?</p>