Retrieve web image

B

bradsalmon

Hi all,

Does anyone know how to save a web image to a local hard drive in vba?

I can save across a html file and have done this for a while but I now
need to get specific images rather than a whole page and there's more
than I want to right click and save as on.

Any thoughts?

Thank you,

Brad
 
B

bradsalmon

Just in case anyone else has this issue as well.

I ended up building my own html page which referenced all the images,
opened this up and then did a save as in IE to get all the images.
Took a while to open the page but got there in the end.

Would still like a vba solution to getting the images if anyone comes
up with one.

Brad
 
K

Karl E. Peterson

bradsalmon said:
Does anyone know how to save a web image to a local hard drive in vba?

Well, the straight-forward way would be to call URLDownloadToFile:

http://vbnet.mvps.org/code/internet/urldownloadtofilenocache.htm

If you have access to VB6, and would like to do it asynchronously, the easiest thing
to do would be to build a UserControl that you could host in VBA. I think it'd be
as simple as making an OCX out of this:

http://vb.mvps.org/samples/NetGrab

In fact, if that sounds appealing, I'd be open to building and uploading that
myself. Lemme know.
 

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