I've been going around in circles for days trying to solve this problem.
I am trying to login to a site and download a file using VBA and an InternetExplorer object. The problem is that once the code clicks on the hyperlink I get a prompt from Internet Explorer (version 10 in my case): "Do you want to open or save "file.xls"? What do I do now?
Here is what I have tried:
URLDownloadToFile. This doesn't work because the file is not accessible without logging in.
Disabling the open/save prompt in Internet Explorer. Also no go. This prompt is designed as a security "feature" and is designed not to be disabled. Some people have mentioned that manually putting in registry keys could do the trick, but it has not worked for me. (Maybe I am not doing the right registry keys?
Is there an download manager add in for Internet Explorer that disables the prompt? I have not found one yet.
SendKeys ("%o") '(Alt + o). This should 'click' Open file. Why not use it? Because it's not reliable. The user sometimes switches the active window away. (Is there a way to "SendKeys" to a specific window?)
Using WinHttpRequest. This should probably work, but it seems like it is a lot of work to learn how to use the WinHttpRequest, and to rewrite all of my code. (Maybe lazy people have more work) Besides, debugging WinHttpRequest would seem to be much more difficult as the actions are not visible while in IE I can watch what is happening.
iMacros. Theoretically, once I enter the fields in the web site I can use iMacros to download the file. The problem with iMacros is that it takes time to load and close. It would have to load FireFox with the iMacro, then load the Web site and then close Firefox. My VBA program is designed to download hundreds of files.
Help! Thank you.