title: Excel VBA Dir Method
body: <p>I have used a form of the following code successfully many times to open multiple files in a folder and I understand how dir helps set the file path before the while loop, but don't quite understand how call the dir method again with no arguments right before the end of the while loop looks up the next file in the folder:</p>
  
  <pre><code>Sub OpenFiles()
  
  Dim MyFolder As String
  Dim MyFile As String
  
  MyFolder = "C:\newFolder"
  MyFile = Dir(MyFolder &amp; "\*.xlsx")
  
  Do While MyFile &lt;&gt; ""
  Workbooks.Open Filename:=MyFolder &amp; "\" &amp; MyFile
  
  MyFile = Dir
  
  Loop
  End Sub
  </code></pre>
  
  <p>When calling Dir on a string that already has been set with a value, is Dir designed to look to the next file in the list of files at that same path?</p>