title: How can I automate Save as dialog box in IE11 using VBA?
body: <p>I am trying to download some data on carbon emissions. I can preload the page with the relevant settings via the URL.
  It loads fine and I can click the OK button by its ID then I get the IE11 - Open/Save/Cancel Dialogue at the bottom. I have tried all suggestions using FindWindows (#32770) and also Send Keys which is very unreliable. Can someone suggest the code to manipulate this dialogue box or else perhaps examine the HTML on the web page to see if a direct download would be possible?</p>
  
  <pre><code>Dim htm As Object
  Dim IE As Object
  Dim Doc As Object
  
  Set IE = CreateObject("internetexplorer.application")
  IE.Visible = True
  IE.Navigate "http://ec.europa.eu/environment/ets/exportEntry.do?form=accountAll&amp;permitIdentifier=&amp;accountID=&amp;installationIdentifier=&amp;complianceStatus=&amp;account.registryCodes=CY&amp;primaryAuthRep=&amp;searchType=account&amp;identifierInReg=&amp;mainActivityType=&amp;buttonAction=&amp;account.registryCode=&amp;languageCode=en&amp;installationName=&amp;accountHolder=&amp;accountStatus=&amp;accountType=&amp;action=&amp;registryCode="
  Do While IE.readystate &lt;&gt; 4: DoEvents: Loop
  Set Doc = CreateObject("htmlfile")
  Set Doc = IE.document
  Doc.getelementbyID("btnOK").Click [embed=file 884739]
  
  'I need code here which clicks the save as button as save the file as C:\temp.xml
  
  Set IE = Nothing
  </code></pre>