[vba]Dim sURL As String
Set ie = New InternetExplorer
Dim ieDoc As Object
sURL = "https://.."

ie.Visible = True
ie.navigate sURL
Do While ie.Busy Or ie.readyState <> READYSTATE_COMPLETE: DoEvents: Loop

With ie.document.forms("logonForm")
.NQUser.Value = "user"
.NQPassword.Value = "password"
.submit
End With

Do While ie.Busy Or ie.readyState <> READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ie.document
ieDoc.all(307).Click
Do While ie.Busy Or ie.readyState <> READYSTATE_COMPLETE: DoEvents: Loop
ieDoc.all(1364).Click
Do While ie.Busy Or ie.readyState <> READYSTATE_COMPLETE: DoEvents: Loop
ieDoc.all(1370).Click[/vba]
This goes to the website, enters username & password, logs in, Clicks a button (307), clicks a download button (1364) and then clicks a button (1370) from a menu that comes up after clicking "Download".

The "Download" link that is clicked is javascript that creates a list with different choices. When you click one of the items on the list a new browser window opens and that opens a prompt to save, open, or cancel the download.

The problem I am having is when vba clicks the menu item a new page opens like its supposed to but it then promptly disappears without ever giving the option to save a file. I do not have a direct link to the file I want to download. My assumption is that the link is created dynamically based on previously selected options.

What can I do to prevent the new window from being closed and to save the file?