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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA download file from internet site

Status
Not open for further replies.

cardiac

Technical User
Feb 19, 2004
31
GB
How do I download and save a file (txt, zip, exe, etc) from an internet site using VBA.
 
You need to to have a fully qualified name.
You need to make and use a reference to WinHTTP. Check and make sure you have winhttp.dll. There is a new version (5.1) - version 5.0 is no longer available from Microsoft.

You make an instance with winHTTP, and then send a WinHTTPRequest. The file (any file) can be brought down and saved as a byte array, as WinHTTPResponseBody.

Gerry
See my Paintings and Sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top