+ Reply to Thread
Results 1 to 10 of 10

Automating Save/Downloads from Internet Explorer

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Question Automating Save/Downloads from Internet Explorer

    A bit of background first:

    I have been automating the Internet Explorer browser for a while however I run into trouble with saving files.

    The first hurdle I ran into was when the download appeared in a popup bar at the bottom of the page (example below) and wants you to click 'Save'. I overcame this by adapting code I found here http://www.experts-exchange.com/Prog..._28205812.html

    147370d1379295401t-internet-explorer-view-track-downloads-bottom_ie9.jpg


    But now I've run into a bigger problem. Some end-users Internet Explorer browsers show new downloads in a "View and Track Your Downloads" window (example below) and my code cant download from it.


    147372d1301936996-internet-explorer-view-track-downloads-example.jpg


    TBH I'm not sure where to start! Does anyone know of a way to download from this window? (Changing the end-users internet settings is a not an option here)
    Last edited by mc84excel; 05-25-2015 at 10:14 PM.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Automating Save/Downloads from Internet Explorer

    Yes, don't use IE for downloading files, we've given you examples in the past using Apis, winhttp and msxml

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automating Save/Downloads from Internet Explorer

    Thanks for your suggestion Kyle. But for this particular project we want a visible download (keeps the non-vba end-users happy by giving them something to look at as it grabs/downloads each report)

    Does anyone else have any idea on how I can edit the FrameNotificationBar code to detect a "View and Track Your Downloads" window and download from it? I'd be grateful if you could help out.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Automating Save/Downloads from Internet Explorer

    I suspect then that you'll just need to use APIs to keep checking for the windows that open. Of course it would likely be impossible to differenciate between them downloading something manually and your code doing so as the dialogues would be the same.

    Tbh it sounds like hard work and will be unreliable at best, a more solid solution would simply be a progress bar in a userform - especially since multiple reports sounds like downloading in a loop, they'd then have something to look at

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automating Save/Downloads from Internet Explorer

    Quote Originally Posted by Kyle123 View Post
    I suspect then that you'll just need to use APIs to keep checking for the windows that open.
    The code I have for the Save Bar uses an API to return the window handle by providing the expected class name. So I was thinking that all I should have to do is to alter the code so that if no handler is found for the Save Bar then to call this function again with the classname for the "View and Track Your Downloads" window.

    The only problem with my plan is that I dont know what the classname is for the new window - worse, I don't know how to go about getting it.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Automating Save/Downloads from Internet Explorer

    See if you can get hold of a copy of spy++ it's a utility that used to come with vs that let's you get that kind of thing

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automating Save/Downloads from Internet Explorer

    Quote Originally Posted by Kyle123 View Post
    See if you can get hold of a copy of spy++ it's a utility that used to come with vs that let's you get that kind of thing
    Hi Kyle, Thanks for the suggestion. Unfortunately I only have the express version of VS (spy++ doesnt come with that version)

    Thinking outside the box, I will try debug.assert false at that point then see if I can loop through all open windows and record their classname?

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Automating Save/Downloads from Internet Explorer

    You can download it separately of you google it, a quick search seems to indicate that plenty of alternatives are available

  9. #9
    Registered User
    Join Date
    06-12-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    1

    Re: Automating Save/Downloads from Internet Explorer

    A couple I use.
    "PAT or JK’s API Spy 5.1" Also Generates some VB code to find and manipulate windows.

    If you have installed "AutoIt" (also free) it comes with a handy spy included.

  10. #10
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automating Save/Downloads from Internet Explorer

    Ironically, I haven't encountered this window since. If I get it again, I will try one of the tools recommended.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to pass Internet Explorer Open/Save/SaveAs dialogbox when downloading a file from web
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-06-2015, 09:25 AM
  2. Replies: 4
    Last Post: 04-05-2014, 08:53 AM
  3. Internet Explorer and VBA : Open, Save and Cancel Dialog Box
    By codeslizer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2013, 04:49 PM
  4. internet file downloads
    By vipul.halbe in forum Excel General
    Replies: 3
    Last Post: 07-04-2011, 11:02 AM
  5. Automating Internet Explorer from VBA
    By Oka in forum Excel General
    Replies: 0
    Last Post: 07-19-2006, 11:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1