How to disable "File Download" excel screen and select "Save" automatically

Pegaso

New Member
Joined
Jun 25, 2012
Messages
21
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:

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)

open


view


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:

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,224,520
Messages
6,179,266
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top