title: Converting from IQy to XLSX with VBA
body: <p>I have a about 40 files that are IQy files that I can open with Excel and I'm trying to go through all of them and save them as xlsx files. What I have so far in VBA is this</p>
  
  <pre><code>Sub ConvertFiles()
      Dim Filename, Pathname As String
      Dim wb As Workbook
  
      Pathname = "C:\Users\CHI\Downloads"
      Filename = Dir(Pathname &amp; ".iqy")
      Do While Filename &lt;&gt; ""
          Set wb = Workbooks.Open(Pathname &amp; Filename)
          wb.SaveAs Pathname &amp; Filename &amp; ".xlsx"
          wb.Close
          Filename = Dir()
      Loop
  End Sub
  </code></pre>
  
  <p>To my understanding this loops through my download file where the iqy files are stored and then saveas in xlsx format. When I run it nothing happens.</p>
  
  <p>UPDATE</p>
  
  <pre><code>Sub ConvertFiles()
      Dim Filename, Pathname As String
      Dim wb As Workbook
  
      Pathname = "C:\Users\CHI\Downloads\"
      Filename = Dir(Pathname &amp; "*.iqy")
      Application.DisplayAlerts = False
      Do While Filename &lt;&gt; ""
          Set wb = Workbooks.Open(Pathname &amp; Filename)
          wb.SaveAs Pathname &amp; Filename &amp; ".xlsx", FileFormat:=51
          wb.Close
          Filename = Dir()
      Loop
  End Sub
  </code></pre>
  
  <p>This is what worked for me, the only problem I have now is after it changes every file I get a prompt to import data and all I have to press is ok. Is there a way to automate this part so that I can import the data using the table option.</p>
  
  <p><a href="https://i.stack.imgur.com/5JN3i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5JN3i.png" alt="Import Data prompt"></a></p>