title: macro - open all files in a folder
body: <p>I want to open all files in a specified folder and have the following code</p>
  
  <pre><code>Sub OpenFiles()
  Dim MyFolder As String
  Dim MyFile As String
  MyFolder = "\\ILAFILESERVER\Public\Documents\Renewable Energy\FiTs\1 Planning
             Department\Marks Tracker\Quality Control Reports"
  MyFile = Dir(MyFolder &amp; "\*.xlsx")
  Do While MyFile &lt;&gt; ""
  Workbooks.Open Filename:=MyFolder &amp; "\" &amp; MyFile
  Loop
  End Sub
  </code></pre>
  
  <p>The problem I have is that it just keeps trying to open the first file in the folder repeatedly and won't move on. Can anybody help, I'm a bit of a novice at VBA and could really do with some assistance. I'm trying to open around 30 reports that are all in .xlsx format. Many thanks in advance.</p>