I am working on automating a report download through IE9, using a VBA Excel macro. I read many threads about this topic and had to compose between several, to adapt it to my situation.
Basically the automation navigates through several pages, checks options, and clicks on a download button. To bypass the Open/Save/Cancel bar on the bottom of IE9, which I didn't find a way to control, I use a sendkey for Control+J to get the View Dowload window pop up. From there I use some other sendkeys to get to the SaveAs button. (it works, but I wish I could use something else). I then have access with FindWindowEx to the next pop up, and save my file easily, with a pathname coming from my spreadsheet. Now after that I still need to close the View Downloads window before I can navigate somewhere else. I would need to know the name of the "windows"(buttons) SaveAs and Close in order to click on them. Something like this (this doesn't work) :
I tried using uuSpy, but I don't see anything relevant. As for the SaveAs I know it must a bit more tricky, as it is a drop down menu and there may be several Save As buttons on the same window...but, if anyone knows about it, it would be great !! Thanks !!
Basically the automation navigates through several pages, checks options, and clicks on a download button. To bypass the Open/Save/Cancel bar on the bottom of IE9, which I didn't find a way to control, I use a sendkey for Control+J to get the View Dowload window pop up. From there I use some other sendkeys to get to the SaveAs button. (it works, but I wish I could use something else). I then have access with FindWindowEx to the next pop up, and save my file easily, with a pathname coming from my spreadsheet. Now after that I still need to close the View Downloads window before I can navigate somewhere else. I would need to know the name of the "windows"(buttons) SaveAs and Close in order to click on them. Something like this (this doesn't work) :
Code:
<code>wndw1 = FindWindow("#32770", "View Downloads - Windows Internet Explorer")
Childwndw1 = FindWindowEx(wndw1, ByVal 0&, "Button", "&Close")
SetForegroundWindow (Childwndw1)
Sleep 1000
SendMessage Childwndw1, BM_CLICK, 0, 0
DoEvents</code>
I tried using uuSpy, but I don't see anything relevant. As for the SaveAs I know it must a bit more tricky, as it is a drop down menu and there may be several Save As buttons on the same window...but, if anyone knows about it, it would be great !! Thanks !!
Last edited: