+ Reply to Thread
Results 1 to 34 of 34

Internet Automation - The Open/Save/Cancel bar in IE11

  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

    Angry Internet Automation - The Open/Save/Cancel bar in IE11

    I've been searching for hours on how to automate the Open/Save/Cancel notification bar that appears in IE11 browser.

    1. Does anybody know of a way this can be done using VBA?


    2. After much searching I've finally found something promising - but its in VB7 not VBA - http://www.experts-exchange.com/Prog..._28205812.html Could anybody please please assist me converting this to VBA? For starters what is VBA equivalent of myWeb that decompile is screaming at?!
    *******************************************************

    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: Internet Automation - The Open/Save/Cancel bar in IE11

    That's nasty. The best way of doing this is simply to replicate the call to the server that downloads the file with a library that can make http requests - something like MSXML or winHTTP. That way you avoid IE altogether, the code is much faster, more reliable and you have to write much less of it!

    I've answered a few threads on here about downloading files and skipping the dialog box so if you search my posts you should find some examples.

  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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by Kyle123 View Post
    That's nasty. The best way of doing this is simply to replicate the call to the server that downloads the file with a library that can make http requests - something like MSXML or winHTTP. That way you avoid IE altogether, the code is much faster, more reliable and you have to write much less of it!

    I've answered a few threads on here about downloading files and skipping the dialog box so if you search my posts you should find some examples.
    Unfortunately the site I need to use this most on I am unable to automate through use of MSXML.

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

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Any site can be automated through msxml or winHTTP, unless the site is flash based in which case you wouldn't be able to automate it with IE either. What particular difficulties are you running in to?


    Sent from my iPhone using Tapatalk

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Internet Automation - The Open/Save/Cancel bar in IE11


    Works usually with SendKeys but efficient way is to use a request.
    Both ways in a recent thread where Kyle and I had written posts …

  6. #6
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by Kyle123 View Post
    Any site can be automated through msxml or winHTTP, unless the site is flash based in which case you wouldn't be able to automate it with IE either. What particular difficulties are you running in to?


    Sent from my iPhone using Tapatalk
    I'm a MSXML newbie so so far I only find it useful for scraping page data from public registers for a batch of records.

    Whereas the site I need the download code for is a secure website (I cant give much more detail than that) that makes very heavy use of Java. The only way I can find to navigate the site reliably is set focus & click on certain page elements in IE. Also the site can only be entered by a login pop-up window.

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

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Http requests are technology agnostic, so it's irrelevant whether the server is using PHP, C# or Java etc, web servers are on the whole pretty dumb, they just respond to text based requests and send content back.

    Heavy use of JavaScript in the browser can seem of putting at first, but all its really doing is sending the same request as a browser would.

    Typically all you need to do to download a file is inspect the request in the developer tools of your browser and replicate it using msxml/winHTTP


    Sent from my iPhone using Tapatalk

  8. #8
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    I managed to use option 2 after adding 32 bit compatibility

  9. #9
    Registered User
    Join Date
    06-08-2015
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    3

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Would you mind sharing the code you used to get this to work Mc84Excel?

    I've been searching constantly as well, but no luck so far.

  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

    Post Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by CHend View Post
    Would you mind sharing the code you used to get this to work Mc84Excel?

    I've been searching constantly as well, but no luck so far.
    The code contains too many characters to put into one post. So I have placed the modules into the XLSM attached.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-08-2015
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    3

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Thank you so much! I really appreciate your assistance!

    Edit : This works SO much better than I could have ever hoped. Honestly, without your help I would have never been able to finish this project I've been trying to complete. Thank you SO much Mc84Excel!
    Last edited by CHend; 06-08-2015 at 08:47 PM.

  12. #12
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by CHend View Post
    Thank you so much! I really appreciate your assistance!

    Edit : This works SO much better than I could have ever hoped. Honestly, without your help I would have never been able to finish this project I've been trying to complete. Thank you SO much Mc84Excel!
    Glad to know it worked for you.

    Thanks. I cant take all the credit - all I did was convert other peoples code so it would be compatible with 32 bit Excel. And add a few minor improvements (e.g. read the registry keys to get the users Downloads folder)

    But I wont say no if you want to rep me (click on the 'Add Reputation' star in the bottom left hand corner of my post)

  13. #13
    Registered User
    Join Date
    06-08-2015
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    3

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Absolutely! I just added the reputation star!

    Thank you again Mc84Excel!

  14. #14
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by CHend View Post
    Absolutely! I just added the reputation star!

    Thank you again Mc84Excel!
    Thanks.

    I don't want to frighten you but this code assumes that the end-users Internet Explorer downloads always appear in a Open/Save/Cancel bar. If the end-users browser settings cause the download to appear in a 'View and track your Downloads' window, the code wont work. For more information, see my thread here: http://www.excelforum.com/excel-prog...-explorer.html

  15. #15
    Registered User
    Join Date
    06-08-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    7

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Hi Mc84Excel,

    May I know how do I get your code to work? I've looked at your file but am at a lost of where to begin.

    Do I copy and poste components of your code into? Is there anything I need to edit?

  16. #16
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by EPSQPSS View Post
    Hi Mc84Excel,

    May I know how do I get your code to work? I've looked at your file but am at a lost of where to begin.

    Do I copy and poste components of your code into? Is there anything I need to edit?
    It wasn't intended to be a stand-alone project. I only uploaded the relevant modules as a workbook because of post size limits.
    1. Download the workbook
    2. Open the workbooks VBA project
    3. Open your workbooks VBA project
    4. Drag all of the modules from my project into yours
    5. In your project, enable reference library 'Microsoft Scripting Runtime' (BTW this was included in the requirement notes at the top of the t_lFSO_AP7_IE_SaveBar_150423 module)
    6. In your procedure that needs to download a file from the IE popup bar, set a boolean variable to fnblnClickFrameNotificationBar and enter the arguments to suit yourself

    HTH

    If you found my reply helpful, consider repping it. (Click on the star in the left hand corner of this post)

  17. #17
    Registered User
    Join Date
    06-08-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    7

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Hi Mc84Excel,

    Thanks for replying.

    Steps 1 to 5 are obvious enough to me. However, I'm lost at step 6.

    "set a boolean variable to fnblnClickFrameNotificationBar and enter the arguments to suit yourself"

    What do you mean by "set a boolean variable to fnblnClickFrameNotificationBar"? Do you mean I should call this function in my procedure and give it the arguments necessary for the function to return a Boolean output?

    As for "enter the arguments to suit yourself", do you mean the following arguments robjIE As Object, strDownloadFileExt As String, strSaveAsPathName As String, strSaveAsFileName As String?

    Lastly, I can figure out what the final three arguments mentioned above are, but what do you enter for robjIE?

  18. #18
    Registered User
    Join Date
    06-08-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    7

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    OOO I GOT IT TO WORK!!!!!!!!!!!!!!!! Yes!!

    Thanks so much Mc84Excel! Figured out the rest on my own.

    Out of curiosity, why does this function work the way it does?
    I typically associate functions with things like SUM, PRODUCT etc. But this function is very different from the UDF I've created; I can't even type it in the spreadsheet.
    Last edited by EPSQPSS; 06-28-2015 at 09:37 PM.

  19. #19
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by EPSQPSS View Post
    Hi Mc84Excel,

    Thanks for replying.

    Steps 1 to 5 are obvious enough to me. However, I'm lost at step 6.

    "set a boolean variable to fnblnClickFrameNotificationBar and enter the arguments to suit yourself"

    What do you mean by "set a boolean variable to fnblnClickFrameNotificationBar"? Do you mean I should call this function in my procedure and give it the arguments necessary for the function to return a Boolean output?
    Yes. Well you could just use
    Please Login or Register  to view this content.
    instead but then if something went wrong, the rest of your code would continue blindly.


    Quote Originally Posted by EPSQPSS View Post
    As for "enter the arguments to suit yourself", do you mean the following arguments robjIE As Object, strDownloadFileExt As String, strSaveAsPathName As String, strSaveAsFileName As String?
    Correct

    Quote Originally Posted by EPSQPSS View Post
    Lastly, I can figure out what the final three arguments mentioned above are, but what do you enter for robjIE?
    robjIE is the object for your Internet Explorer browser. If you have a reference to Microsoft Internet Controls in your project then you could replace the Object with InternetExplorer or InternetExplorerMedium

  20. #20
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by EPSQPSS View Post
    OOO I GOT IT TO WORK!!!!!!!!!!!!!!!! Yes!!

    Thanks so much Mc84Excel! Figured out the rest on my own.
    Well I was offline for a few days. I wasn't trying to force you to figure it out yourself!

    But I'm pleased you did manage to work it out. Thanks for the rep btw.


    Quote Originally Posted by EPSQPSS View Post
    Out of curiosity, why does this function work the way it does?
    I typically associate functions with things like SUM, PRODUCT etc. But this function is very different from the UDF I've created; I can't even type it in the spreadsheet.
    I can understand your confusion but I'm not sure how to best explain it to you. Since your question is beginning to get off topic of this thread, I recommend you start a new thread for this.

    (Just quickly - SUM and PRODUCT are in-built Excel functions. Most functions you create yourself are usually not suitable to use as a UDF in a worksheet. The reason why this function isn't visible is most likely due to the visibility of its scope)

  21. #21
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Sorry mitko007
    The code uploaded in the workbook assumes that the end-users Internet Explorer downloads always appear in a Open/Save/Cancel bar. If the end-users browser settings cause the download to appear in a 'View and track your Downloads' window, the code will not work.


    If anyone knows how to automate the 'View and track your Downloads' , I would appreciate your input: http://www.excelforum.com/excel-prog...-explorer.html

  22. #22
    Registered User
    Join Date
    07-25-2013
    Location
    Austria
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Thanks mc84excel,

    is there a way to configure the IE in a way that the View and track your Downloads window is avoided and always get the save/open/cancel bar?

  23. #23
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by mitko007 View Post
    is there a way to configure the IE in a way that the View and track your Downloads window is avoided and always get the save/open/cancel bar?
    I don't know. There probably is - but even if there was, I would still prefer to have code that would handle the VATYD window (Rather than demand all end-users to make settings changes in their IE browsers)

  24. #24
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Hello mitko007, I am answering you PM in the thread to help others who may have this problem

    Quote Originally Posted by mitko007
    Ok i followed your steps once again, now i get an Argument Type MisMatch error on the ie argument.

    I have declared my IE object in my code as:

    Please Login or Register  to view this content.
    OK What type did you dim 'ie' as?

    Here's a few things you can try:
    1. Alter the function argument so it's ByVal instead of ByRef (Not recommended but may work)
    2. Try changing the functions argument to
      Please Login or Register  to view this content.
      (Not recommended but may work)
    3. Try changing the functions argument to
      Please Login or Register  to view this content.

    Note that the last method may throw up a different error in your code if you haven't already added the reference library "Microsoft Scripting Runtime" to your project (From your use of 'CreateObject' I suspect you probably haven't)
    I'm afraid I don't have time right now to tell you how to add "Microsoft Scripting Runtime" to your projects References. So if you don't already know how to add a reference library to your project, you will need to google this.

  25. #25
    Registered User
    Join Date
    07-25-2013
    Location
    Austria
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    mc84excel, thanks for the help mate. I got it to work with the small save/open/cancel bar.

    BTW, i figured out why i was getting the big download manager window. I checked the html code of the website i was downloading from and they have a close.window command which closes the screen and thus only the View & Track downloads remains. Anyway, this is a bit off topic but perhaps it may help others as you said.

    Best regards and thanks once again!

  26. #26
    Registered User
    Join Date
    09-26-2013
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    5

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    mc84excel, I am trying to integrate your code with mine and keep hitting a wall.

    I am a novice programmer and only recently started figuring out basic code, so please take baby steps.

    Here is my code...where do I go from here?

    Please Login or Register  to view this content.

  27. #27
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by playdoh113 View Post
    mc84excel, I am trying to integrate your code with mine and keep hitting a wall.
    Hi playdoh, did you follow the steps in post #16?

    From a quick glance at your code, try editing the section below (untested):
    Please Login or Register  to view this content.

  28. #28
    Registered User
    Join Date
    02-25-2017
    Location
    Vietnam
    MS-Off Ver
    2013
    Posts
    1

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Hi Mc84excel,

    Thank you so much for your help with your code. It works for me in first click to download, but when i use a loop to click 2nd to download (with first notification bar still available, not close), this not works again. And we must close first notification bar first before downloading 2nd. Could you please help me if any way to use VBA close notification bar when completion download?

  29. #29
    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: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by nhatanh.tth View Post
    Hi Mc84excel,

    Thank you so much for your help with your code. It works for me in first click to download, but when i use a loop to click 2nd to download (with first notification bar still available, not close), this not works again. And we must close first notification bar first before downloading 2nd. Could you please help me if any way to use VBA close notification bar when completion download?
    I don't know how to close the notification bar but it shouldn't be necessary to do this. I frequently download two files in succession (the second time with the downloads bar visible) without needing to close this before the 2nd download.

    One trap I may not have mentioned in this thread to now (can't remember if I have) is that it is very easy for the macro to lose focus. To avoid this happening, I take my hands off the mouse (and keyboard too) while this particular macro is running.

  30. #30
    Registered User
    Join Date
    10-20-2017
    Location
    Murcia, Spain
    MS-Off Ver
    2016
    Posts
    1

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Dear mc84excel,

    I would like press on "save" or "save as" for downloading automatically a file, but I have no idea how to modify your macro to make it work.
    I'm stuck at the 6th point
    • In your procedure that needs to download a file from the IE popup bar, set a boolean variable to fnblnClickFrameNotificationBar and enter the arguments to suit yourself
    Can you make it work for me with the following link, to have an example?
    https://indexes.nasdaqomx.com/Index/...eightings_2015

    Thank you a lot in advance!

    Best regards,

    Koen de Haan

  31. #31
    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

    Post Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Quote Originally Posted by mc84excel View Post
    The code contains too many characters to put into one post. So I have placed the modules into the XLSM attached.
    Am uploading my most recent version of this code. If you find it useful, feel free to rep!
    Attached Files Attached Files

  32. #32
    Registered User
    Join Date
    02-22-2021
    Location
    Italy
    MS-Off Ver
    2010
    Posts
    1

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    Hi Mr Excel and all,
    did anyone find a solution for the 'View and track your Downloads'- window? It seems the suggested subthread listed above (08-04-2015, 04:26 AM) disappeared.

    I am trying to get my head around what the subwindows (Open, Save) are called or how to get a handle to them.

    Thanks

  33. #33
    Registered User
    Join Date
    07-28-2023
    Location
    India
    MS-Off Ver
    2016
    Posts
    2

    Re: Internet Automation - The Open/Save/Cancel bar in IE11

    I don't see any code in this file. I have unblocked the file in the Properties.

  34. #34
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Internet Automation - The Open/Save/Cancel bar in IE11


    As all the codes are yet inside the attachment ‼ …

+ 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. Replies: 4
    Last Post: 04-05-2014, 08:53 AM
  2. VBA and IE9 - override the "open, save, cancel" pop-up
    By Per Olander in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-11-2013, 06:22 PM
  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. Using VBA to cancel hanging internet connection
    By DLW1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2011, 07:30 PM
  5. Cancel Macro is user selects 'cancel' at save menu
    By Mark in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2005, 01:06 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