Bypass or Accept Internet Explorer Dialogue Box When Exporting Webform Results

  • Firstly, I should state that my knowledge of the Microsoft Internet Controls and MSHTML libraries is low. I started using them recently to try to automate the downloading of excel reports from a webform. As such, this has been a learning experience, and my code definitely reflects that.


    The task:
    I have a webform which is all scripted in Java. After initializing the page, a javascript determines what tab to display, etc. The result is that the page requires a generous amount of navigation to get to the input elements and to the export link (My guess is there is a better way for this as well, but that is not in scope for this post). I want to fill in the form, then click the link to export the results to excel.


    The problem:
    I have been able to fill in the form and get it to fire the export link. I am stuck here.


    After I export the report, IE (I am restricted to IE at work...) opens a new window and then an Excel dialogue box opens with options to open, save, or cancel the document sent from the server. The file name of the export is not constant, and I don't know how to get the path of the export to feed to Excel.


    I know methods to access the workbook after I open it, but I am stuck on how to actually open the workbook. Any help would be appreciated.


    Obviously, posting the URL would be the best way, but it is restricted, so I cannot.


    The code:

    Regards,


    WidgetWonka
    Puuuureeee Imagination

  • Re: Bypass or Accept Internet Explorer Dialogue Box When Exporting Webform Results


    Try using

    Code
    ThisWorkbook.FollowHyperlink Address:=doc13


    in place of

    Code
    doc13.Click
  • Re: Bypass or Accept Internet Explorer Dialogue Box When Exporting Webform Results


    Thank your for your reply. Unfortunately, it did not work. The link executes a script which sends the form for processing and returns the workbook. Following the hyperlink opens a blank instance of the results form, but not a workbook.

    Regards,


    WidgetWonka
    Puuuureeee Imagination

  • Re: Bypass or Accept Internet Explorer Dialogue Box When Exporting Webform Results


    Without seeing the source code, it makes it difficult to offer further suggestions. What is the text of the link that you are clicking? If I can think of anything else helpful, I will post it here. Good luck to you.

  • Re: Bypass or Accept Internet Explorer Dialogue Box When Exporting Webform Results


    What OS are you using? If it is not windows 7 you can go to my computer>tools>folder options>file types. Scroll down to the excel file extensions(they are at the bottom and begin with X). Select these and then click advanced. In the new window uncheck the confirm open after download box. The open,save,cancel box should no longer display. I was playing with it this morning and remembered that I had done this with a workbook I created some time ago. When I rechecked this box I started to get the dialog box when I ran the macro. If you have windows 7 there is no direct way to alter the file types settings(from what I have read) but there are programs that give you that functionality.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!