title: Using Excel VBA, open a web page and then save it
body: <p>I'm trying to write a macro that will open a given URL and perform a File >> SaveAs...  The URL returns an XML output on the screen and I want to save it.  Then I can have Excel open the file and work on it (this part I can do).</p>
  
  <p>Here's basically what I want to do and it works except for the SaveAs bit:</p>
  
  <pre><code>Sub Main()
  REM Reference to "Microsoft Internet Controls" is being used.
  Dim objIE As InternetExplorer
  
  Set objIE = New InternetExplorer
  
  With objIE
      .Visible = True
      .navigate "http://exampleURL.comany.com/ServerOutput/XmlFile.xml"
      Do Until .readyState = 4
          DoEvents
      Loop
  
      REM The next line fails
      .SaveAs "C:\temp\test.xml"
  
      .Application.Quit
  End With
  
  Set objIE = Nothing
  End Sub
  </code></pre>
  
  <p>A plain "Save" is fine if that's all that will work.  Just looking for a way to save the output on the screen.  Thanks!</p>