How to detect download dialogue in internet explorer 9+ using VBA? - vba

I need to authenticate to a website.
After successful authentication - a form is shown, where a few details are filled.
After submitting the form, the page gives an impression that something is loading:
After a non-fixed delay, a download pop up is shown:
Sadly, assuming if I try to download from URL, I cannot overcome the authentication part. The web browser client is authenticated, not the VBA client.
My simple question is:
How to detect, whether this download pop up has appeared or not in IE9+?
A few things I have tried:
URLDownloadToFile is of no use, since the download link for the file is not fixed and appears after authentication
Siddharth's answer, does not addresses IE 9 download dialogue box, rather works for IE 8 dialogue box
I believe that after successfully detecting this pop up, I can download the file to local disk simply using SendKeys - correct me if needed.
Side question: how to download the file to local disk after detection is successful?

Related

Run Time Error '15' - Can not open the specified file (Application.followhyperlink) -

I am trying to trace down a runtime error that is happening to a few team members while attempting to open a PDF file link from Access. The VBA code is using an Application.followhyperlink to pass a hyperlink to our SSRS report server. The VBA code correctly passes the URL (it works on my machine) which opens a dialogue box (Microsoft Office) asking the user if they, "Would like to open this file?". What is supposed to happen is that a web browser opens with the link (and then the PDF file opens from it), but instead the code breaks with the error message of: Run Time Error '15' - Can not open the specified file.
It feels like the issue is with the web browser security (or windows) security.
We are running Microsoft Edge as the default browser. I have tried to play with the security settings with no luck.
Anyone else experience this or have a solution?
Thank you, Brent
Our IT department updated the user's browser (edge) and it resolved the issue. I also tested the code in the links provide and it also worked. Thank you!

Automating File Download of a link that looks like this: https://www.domain.com/TableData/TableA.csv

I am trying to write an application that will download .csv and .xls files and save them into a folder that will be accessed later by a VBA macro. I am posting this question after the unsuccessful use of the solution in the following link: How do i download a file using VBA (Without internet explorer)
The macro runs successfully, but the downloaded .csv file only contains the html from the login page. I find that strange because when I copy and paste the link directly into the browser without logging in, I am immediately prompted with a save, open, close window for the file.
As much as possible I am trying to avoid using SendKeys, but I can't seem to find another solution that works. I am not opposed to options other than VBA. Any help would be appreciated, thank you.
Your browser stores cookies which likely allows you to login automatically. Try browsing the page in different tabs in an incognito browser and you'll likely have to login each time.
You'll have to find a way to make the same requests your browser is sending to login, and use the cookies stored to make the requests to download the files.

WebDav Pdf Saving error

I have set up a webdav folder that I can access thorugh chrome and edit files and save them back to the server, for example, I can open a word doc, edit it and save it back.
When I come to open a pdf, it wont save back to the server and downloads a copy of the pdf instead of the original.
Is there a way of enabling this to edit a pdf?
My end goal is to be able to open a pdf, add comments/highlights and save it back to the server, through my browser.
Thank you
Edit:
I have set this up through Apache 2.4, no plug ins through chrome, I have mapped a network drive to the server folder where I can open and edit files. Except PDFs, I would like to add comments to a off but when I open one the option is greyed out and when I try and save it after opening it tries to save to my desktop.
I'm not sure i've got your use case right, but if i've understood you correctly you have a link in a web page to a PDF which you're viewing in chrome. You click on that link and the PDF downloads to a temp file from which it is opened. If you edit and save those changes are simply saved to the temp file on your local PC. Is that correct?
If so, then this is simply normal behaviour for links in web pages. There is absolutely nothing in the HTML standard which suggests links should be opened by an editor with knowledge of the source location.
What you really want is for the link to launch an editor program which retrieves the remote document in edit mode (probably locking the remote resource) and then have edits saved back to the server. For this to happen there generally needs to be some special interaction in the browser. In Internet Explorer this is provided by the sharepoint dll and special script code. I think there's a plugin for Chrome which does the same thing, although differently.
I havent used the Chrome plugin, but i think this might help - https://code.google.com/p/npapi-msdocs/

IE 10 not using AppCache after browser closed

I wrote an application using the HTML5 Cache Manifest and I'm having a problem using it in IE 10.
I used Fiddler to witness the manifest file being downloaded and all resources fetched on the initial load of the application. If I disable my network adapter to force the machine offline, the application continues to work as expected as long as I don't close the browser window.
However, when I close the browser window, then attempt to re-open the page from a favorite, IE 10 tells me "You're not connected to a network". Obviously I know that, I'm trying to use the app offline. These exact steps work in Chrome.
Is this behavior by design? Is there a workaround? I can't test with IE 11 right now...is this different in IE 11?
Hearing of some issues of the appcache clearing if your company utilizes gpo settings and has "empty temporary internet files folder when browser is closed" enabled.
Did you find the answer to this? I have the same problem. I did get a bit further though. I found that if you go to the IE10 File menu option and tick Work Offline then try and access your cached app it loads the page but I still have an issue as it does not appear to be using the javascript file that should also be cached. All works ok on Google Chrome but our clients are restricted to IE so Chrome is not an option.

How to download internet(http) file in SL4 out of browser project?

my function open a internet page in pop-up browser before to download a file. But after I change to SL4 and out-of-browser, seems the pop-up is no longer working
System.Windows.Browser.HtmlPage.PopupWindow(_uri, "Report", null);
and then I also tried HttpWebRequest and WebBrowser. Seems they both won't ask the user to download the file or not, but just stay silence.
Finally, I sloved this by checking when OOB mode, use Shell command for the http URL, then a download box will prompt directly.