Excel VBA FTP

D

DownThePaint

I've tried several .bat examples and the MS INET for doing an FTP transfer
using Excel VBA and so far none of them work. Does anyone have a code
snippet? The simpler the better:)

Thanks,
 
R

roger

DownThePaint said:
I've tried several .bat examples and the MS INET for doing an FTP transfer
using Excel VBA and so far none of them work. Does anyone have a code
snippet? The simpler the better:)

Thanks,

Dim inet1 As InetCtlsObjects.inet

Set inet1 = New InetCtlsObjects.inet
With inet1
.Protocol = icFTP
.URL = "ftp://ftp.private.com"
.UserName = "George Washington"
.Password = "no_lies"
.Execute , "CD gifs\thegifs"
.Execute , "PUT C:\source.txt target.txt"
.Execute , "CLOSE"
End With

Set inet1 = Nothing

That's an example from MSDN VB5, it works for me in Excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top