Thanks Prasad,
I found the following thread in other famous excel-VBA user forum:
http://www.mrexcel.com/forum/excel-questions/353006-download-file-excel.html
Three codes are proposed there, the second one would cover my needs:
Sub Test2()
Dim i As Long
Dim FileNum As Long
Dim FileData() As Byte
Dim MyFile As String
Dim WHTTP As Object
On Error Resume Next
Set WHTTP = CreateObject("WinHTTP.WinHTTPrequest.5")
If Err.Number <> 0 Then
Set WHTTP = CreateObject("WinHTTP.WinHTTPrequest.5.1")
End If
On Error GoTo 0
If Dir("C:\MyDownloads", vbDirectory) = Empty Then MkDir "C:\MyDownloads"
For i = 1 To 10
MyFile = Cells(i, 1).Text
TempFile = Right(MyFile, InStr(1, StrReverse(MyFile), "/") - 1)
WHTTP.Open "GET", MyFile, False
WHTTP.Send
FileData = WHTTP.ResponseBody
FileNum = FreeFile
Open "C:\MyDownloads\" & TempFile For Binary Access Write As #FileNum
Put #FileNum, 1, FileData
Close #FileNum
Next
Set WHTTP = Nothing
MsgBox "Open the folder [ C:\MyDownloads ] for the downloaded file..."
End Sub
The info I need to download is password-protected, so I cannot give you the login info for you to take a look, but below is a screen-capture. As you can see, each URL directs the user to a "vault" with few files in there (usually .pdf but also .doc or .gif). What I want is basically to replicate the content of each vault in my local HD. The code above doesn't work for my case, even if you input the file's location (you can know it after you click in the link, the little folder to the right), but since the files come in different formats, the dialog to save them is not always available (Just with the .pdf files seems to work fine), for the rest it would be required to select the file (ctrl+A), copy & paste it to a new document, and save it.
It is probably more complicate that I thought at the beginning, also I need to say that at the same time I posted the same question in other forums, (with no success by the way), should I include links to those here?
Warmest regards! - Pegaso