PDA

View Full Version : IE Automation "Download File" dialog box



asipoy
11-28-2012, 05:57 AM
I have an internal web based tool from. Using Excel VBA I submit the user credentials, open a report page, auto submit all the required details on a web form and click on show report button. This will generate a report that will be displayed on the web page and also allow the user to export it to excel.
There are two option available for me here. either i loop through all the rows and columns in the html table displayed on the web page and get the data in the excel sheet. Second option is to click on the "Generate Report" link which will prompt me with a download file dialog box (IE Download window). the first option is too slow and hence I have only one choice left.
however, there is no way that i can either open the document by clicking on the "Open" button or save it by clicking on the "Save" button. I would prefer opening it as it will save my from specifying the location and then reopening it again from there.
Also to add to this, this is not a direct link. the report is generated only after the form fields are filled and submitted to the server.
The url looks like:
admin.abcd.com/admin/report.jsp?selReportFormat=E
So I cannot even direcly download from the above url. If i try the shortcut what i get is a blank file of 1 KB.
Could anyone please suggest me a workaround to this.
I have already searched google and multiple forums for this but have received no success.

mohanvijay
11-29-2012, 12:14 AM
Try this for download file

http://vbaexpress.com/kb/getarticle.php?kb_id=1146

asipoy
11-30-2012, 06:10 AM
Thanks for the reply. I will look into this and get back to you on this.