Hi,

I've been troubled by this one for a while.

I am trying to write a macro that downloads an Excel file automatically. It navigates to the web page, selects the appropriate values and checkboxes, and then clicks submit. This submission then simply opens up a new tab that contains the results data I need.

There is actually a button on this page that will allow me to export to Excel. This should make it easy, but I'm having trouble because this page has the exact same URL and title as the previous page (the one which I previously navigated to). I'm not sure how to get to this specific page to click the export button - right now my code seems to be searching the old input page for the button.

Please Login or Register  to view this content.
I get error 424: Object Required. If I change the "btnExport" to "btnSubmit", then the code goes through, which tells me that the active web page is still the previous tab (the input page rather than results page). Here are what I believe my options are, none of which I have figured out successfully:
Correctly navigate to new results page
Close old input page (I don't need it anymore), and navigate to new results page
Screw the Export to Excel button, do it manually through VBA

How should I do this?