Dear All,
I need to download some files from my company intranet website, so I can not post here any examples of the data, but I will try to be as specific as possible.
I created a "Microsoft Web Browser" control within my excel spreadsheet, using the code below I navigate using an URL that indicates that the file must be downloaded, at this stage excel opens the "File Download" screen and asks the user for "Open", "Save" or "Cancel", if the user selects "Save" another screen prompts for the folder location and file name.
In order to make the process automatic, I need to tell excel to always save the file in the same location, re-name if already existing.
Below is the code I have so far:
This is the "File Download" screen I need to set up to automatically select "Save" in the same location every time (not sure if it is going to be displayed)
Also available through here:
https://drive.google.com/file/d/0Bz1zHYte4PdFWVg1WE1adnJJZUE/view?usp=sharing
Thanks in advance for all your support.
Rgds,
Pegaso
I need to download some files from my company intranet website, so I can not post here any examples of the data, but I will try to be as specific as possible.
I created a "Microsoft Web Browser" control within my excel spreadsheet, using the code below I navigate using an URL that indicates that the file must be downloaded, at this stage excel opens the "File Download" screen and asks the user for "Open", "Save" or "Cancel", if the user selects "Save" another screen prompts for the folder location and file name.
In order to make the process automatic, I need to tell excel to always save the file in the same location, re-name if already existing.
Below is the code I have so far:
Code:
Sub DownloadDocs()
Application.DisplayAlerts = False
Application.ScreenUpdating = True
Dim url As String
Dim i As Integer
For i = 1 To 20000
'This is the url to download the file
url = Sheets("CTRL").Cells(15 + i, 17)
Sheets("CTRL").WebBrowser1.Navigate (url)
Do
DoEvents
Loop Until Sheets("CTRL").WebBrowser1.ReadyState = READYSTATE_COMPLETE
Next i
This is the "File Download" screen I need to set up to automatically select "Save" in the same location every time (not sure if it is going to be displayed)
Also available through here:
https://drive.google.com/file/d/0Bz1zHYte4PdFWVg1WE1adnJJZUE/view?usp=sharing
Thanks in advance for all your support.
Rgds,
Pegaso
Last edited: