Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Download file to computer from FTP
Hello-
I found the following code to download a csv file from an FTP site, but I am getting an error message in VB that I don't understand. The code is below: Sub FTPCheck() Const cHost = "ftp://XX.XX.XX.XXX/VERPNDDIV.csv" Const cUserName = "MyUserName" Const cPW = "MyPassword" Dim strData As String Dim strTempFile As String strData = "VERPNDDIV.csv" strTempFile = "C:\" & strData MsgBox DownloadFile(cHost, cUserName, cPW, strData, strTempFile) End Sub Function DownloadFile(ByVal HostName As String, _ ByVal UserName As String, _ ByVal Password As String, _ ByVal RemoteFileName As String, _ ByVal LocalFileName As String) Dim FTP As InetCtlsObjects.Inet <----This is the line that is highlighting as an error Set FTP = New InetCtlsObjects.Inet With FTP .URL = HostName .Protocol = 2 .UserName = UserName .Password = Password .Execute , "Get " + RemoteFileName + " " + LocalFileName Do While .StillExecuting DoEvents Loop DownloadFile = (.ResponseCode = 0) End With Set FTP = Nothing End Function Does anyone have any ideas? Or know of a simple way to pull a csv file from an FTP site using code? Any help would be appreciated. Thanks- Scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What program do I need to download clip art onto my computer? | Excel Discussion (Misc queries) | |||
How do I download it on my computer decktop? | Setting up and Configuration of Excel | |||
How do I re-download Excel onto my computer (it crashed)? | Excel Discussion (Misc queries) | |||
How do I download Excel to my computer after installing XP | New Users to Excel | |||
How 2 get partial office download out of computer-do NOT have off. | Excel Discussion (Misc queries) |