title: Controlling IE11 "Do you want to Open/Save" dialogue window buttons in VBA
body: <p>We need to download file from a NASDAQ website automatically. My existing VBA code is opening an IE "Do you want to Open/Save" dialogue window. How to click on that save button and give a path via VBA ?
  I have tried various windows api methods described in this link <a href="http://www.siddharthrout.com/2011/10/23/vbavb-netvb6click-opensavecancel-button-on-ie-download-window/" rel="nofollow noreferrer">here</a> also but that is giving a result of "Window Not Found".</p>
  
  <p>My current code is as below:</p>
  
  <pre><code>Sub MyIEauto()
  
      Dim ieApp As InternetExplorer
      Dim ieDoc As Object
      'Dim ieTable As Object
  
      'create a new instance of ie
      Set ieApp = New InternetExplorer
  
      'you don’t need this, but it’s good for debugging
      ieApp.Visible = True
      'assume we’re not logged in and just go directly to the login page
      ieApp.Navigate "https://indexes.nasdaqomx.com/Account/LogOn"
      Do While ieApp.Busy: DoEvents: Loop
      Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
  
      Set ieDoc = ieApp.Document
      'fill in the login form – View Source from your browser to get the control names
      With ieDoc.forms(0)
          .UserName.Value = "xxxxxxx"
          .Password.Value = "xxxxxxx"
          .submit
      End With
      Do While ieApp.Busy: DoEvents: Loop
      Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
  
      'now that we’re in, go to the page we want
      ieApp.Navigate "https://indexes.nasdaqomx.com/Index/ExportWeightings/NDX?tradeDate=2015-08-19T00:00:00.000&amp;timeOfDay=SOD/SODWeightings_2015"
  
      'next below line commented as it is failing
      'ieApp.ExecWB 4, 2, "D:\VBA code work\SODWeightings_20150819_NDX.xlsx" 
  
      set ieApp=Nothing
      set ieDoc=Nothing
  
  End Sub
  </code></pre>
  
  <p>The screenshot below shows where I have reached. How do I progress from here?</p>
  
  <p><a href="https://i.stack.imgur.com/grEZD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/grEZD.jpg" alt="enter image description here"></a></p>