Excel VB control of IE popup

simonphillips

New Member
Joined
Mar 25, 2008
Messages
32
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Thanks for all the great people who make this resource the "end of the rainbow" for those of us still learning all the wonderful abilities of Excel :)

My Task: I have a VB script that needs to trawl through multiple webpages downloading a file on each page. The file download is initiated by hitting a button on the webpage.

I have used the standard pattern below to open the webpage:
Code:
With IEPage
            .Visible = True
            .Navigate PageString
            Do Until .ReadyState = 4: DoEvents: Loop
            Do Until .Document.ReadyState = "complete": DoEvents: Loop
            
 End With

My problem is that the download is an excel file and I am prompted with a open/save/cancel popup window.

How do I access the controls on the popup from my macro (preferably to open the file) ?

The intention is then to select the relevant cells from worksheet (opened within IE) and paste into the relevant part of my master sheet. Alternatively I could just save and manually manipulate the set of saved files.

TIA

Simon
 
Hi Andrew,

Thanks for taking the time to look at my post. Apologies for not originally explaining that I have already attempted to use the SendKeys approach.

The problem is that if I put this after the ReadyState = complete line, it never gets to the sendkeys line. I think the reason is that the excel file is opening "inside" the internet explorer application it never gets to this state ?

Hoping you may have some further options :-)

Simon
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top