PDA

View Full Version : Issue with the macro which downloads the files from internet.



abhay_547
09-10-2010, 05:54 AM
Hi All,

I have the below mentioned code which downloads the file from a website.
but the issue is that it doesn't directly download the file on the given path it gives a popup box to get the confirmation from the user that he wants to "Open", "Save" or "Cancel" the download. I want that the user shouldn't get any such popup and the code should directly download the file to the given path apart from this I want to use the same code to download multiple files at one go.

The below code works fine for one link but if I try to download the files from multiple links it doesn't work.

Here is my code :


Sub Downloadfilesfromnet()
'Need to reference to Microsoft Internet Controls
Dim URL As String
Set IE = CreateObject("internetexplorer.application")
URL = "http://www.xyz.com/abc.zip" 'for TEST
Dim IE As Object
IE.Visible = True
IE.Navigate URL
Do While IE.ReadyState <> 4
DoEvents
Loop
SendKeys "%S"
IE.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT 'SaveAs
End Sub


I have attached my macro file and screenshot of the userform for your reference.

Thanks a for your help in advance.:bow: