Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to import pictures from a URL

Status
Not open for further replies.

grnzbra

Programmer
Mar 12, 2002
1,273
US
I have a table with a list of .jpg files and the website where they are located. I need to loop through the list and import these pictures and save them in a folder using VBA. Can this be done and how?
 
A simple Do...Loop statement with a nested FileCopy statement should work fine.


"Only the educated are free.
 
The loop I can handle. My problem is with the file copy statement going to an site. Unfortunately the Help files seem to be rather cryptic about it.
 
Sorry, after looking into it further, I realized that due to file-naming conventions in these statements and the ones like it, they prevent the user from implementing any global address and force use of only local files. Much in the same way that you can't add a grafic to a form that is located at an internet address.

So you are left with a more difficult path; implementing an FTP service library and making this type of connection and downloading the files via this route.

There are a number of library-based clients out there that you can implement and control through VBA. Check into CuteFTP, VoyagerFTP, and BulletProofFTP.

Another option maybe to implement a browser control on a form, connect to the address of the graphic you are looking to copy and then trying an acCopy of the contents of the control. I haven't tried this yet, but it may at least be worth a shot.


"Only the educated are free.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top