View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Copy files from website?

Robert Crandal wrote:

"Auric__" wrote in message
44.100...
Robert Crandal wrote:

Does it *need* to be VBA? While VBA certainly can do it, it's much simpler
to use a download manager like wget or curl from the command line:
cd "local folder"
wget http://blue/our_site/img/444.001.jpg


I cant install "wget" or "curl" at work. I thought maybe VBA
had some functions for downloading files from a website.


Well... if it was me, I'd just run wget from a USB drive... if it was me.

But since you're not me, you can try this:

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 grabfile()
URLDownloadToFile 0, "http://blue/our_site/img/444.001.jpg", _
"C:\dir\you\have\write\access\to\444.001.jpg", 0, 0
End Sub

If that doesn't work, there's more than one way to skin this cat. Google for
"automate internet explorer vb", without quotes.

--
In the meantime why let the worry mice gnaw at one's mind?