csv file download

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

I have 17 csv files that I download individually daily
from a website, can anyone tell me the quickest way to do
this ie some sort of automation.
Thanks
Les.
 
Consider using the Microsoft.XMLHTTP object. With VBScript you could do
something like:

Sub GetCSV(sSource, sDest)
Dim oHTTP, oFSO, oTS

Set oHTTP = WScript.CreateObject("Microsoft.XMLHTTP")
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set oTS = oFSO.CreateTextFile(sDest, True)

oHTTP.open "GET", sSource, False
oHTTP.send
oTS.Write oHTTP.responseText
oTS.Close

Set oTS = Nothing
Set oHTTP = Nothing
Set oFSO = Nothing
End Sub

GetCSV "http://www.maxmind.com/GeoIPCountrySample.csv", "CountrySample.csv"

Instead of writing to a file, you could do this within XL and have it
populate worksheets, etc.

/i
 
Back
Top