[HELP] Download images from a list of urls (in excel sheet) to my local disk

A

anto888

Hi, i have a sheet with a list of urls of some pictures:


http://www.mysite.com/cbcuu/$5Gbewh60.jpg
http://www.mysite.com/cbcuu/$"£%"£wh60.jpg
http://www.mysite.com/cbcuu/$rf34ewh60.jpg
http://www.mysite.com/cbcuu/$5G$£h60.jpg
http://www.mysite.com/cbcuu/$5G65h60.jpg
http://www.mysite.com/cbcuu/$5G"£££h60.jpg
http://www.mysite.com/cbcuu/$5Gbtgtgh60.jpg


I need a tool that will automatically connect to the url and downloa
the images in a folder.
So now i have new urls like these:


C:\User\Anto\Pictures\$5Gbewh60.jpg
C:\User\Anto\Pictures\$"£%"£wh60.jpg
etc.


Then the tool must re-insert the new urls in the excel sheet near th
old urls.


I hope this can be done in excel. Thanks very much and sorry for m
not-perfect english.


Hope you have a nice day
 
P

plinius

Il 25/09/2012 10:12, anto888 ha scritto:
Hi, i have a sheet with a list of urls of some pictures:


http://www.mysite.com/cbcuu/$5Gbewh60.jpg
http://www.mysite.com/cbcuu/$"£%"£wh60.jpg
http://www.mysite.com/cbcuu/$rf34ewh60.jpg
http://www.mysite.com/cbcuu/$5G$£h60.jpg
http://www.mysite.com/cbcuu/$5G65h60.jpg
http://www.mysite.com/cbcuu/$5G"£££h60.jpg
http://www.mysite.com/cbcuu/$5Gbtgtgh60.jpg


I need a tool that will automatically connect to the url and download
the images in a folder.
So now i have new urls like these:


C:\User\Anto\Pictures\$5Gbewh60.jpg
C:\User\Anto\Pictures\$"£%"£wh60.jpg
etc.


Then the tool must re-insert the new urls in the excel sheet near the
old urls.


I hope this can be done in excel. Thanks very much and sorry for my
not-perfect english.


Hope you have a nice day.



Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String,
ByVal _
szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As
Long) As Long

Sub DownloadFilefromWeb()
Dim SPath As String, ret As Long, Addr As Range, v As Range
Set Addr = Range("Sheet11!A2:A9")
SPath = "C:\MyDir\MySubDir\"
For Each v In Addr
ret = URLDownloadToFile(0, v, SPath & Mid(v, InStrRev(v, "/") + 1),
0, 0)
v.Offset(, 1) = IIf(ret, "Error", "Ok")
Next
End Sub


Set the sub for your range and your path.

Hi,
E.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top