Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default Ftp From Excel

Could you tell me how to do a Ftp from VBA in Excel. I
need to pass the user name and password so I will not be
prompted.

Thanks,

Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Ftp From Excel

Hi,

How about using Shell command like this?

Shell "ftp -s: myfile myserver", vbHide

Cheers,

"GJones" wrote:

Could you tell me how to do a Ftp from VBA in Excel. I
need to pass the user name and password so I will not be
prompted.

Thanks,

Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Ftp From Excel

Oooops,

I forgot to tell you important bit.

Typically we create a file that includes parameters being passed to FTP
command. So, first create a text file and pass that as parameter of FTP
command, something like:

Dim l_fso As Scripting.FileSystemObject
Dim l_ts As Scripting.TextStream
dim szCommandText as String
szCommandText = "C:\my_command_text.txt"

Set l_fso = New Scripting.FileSystemObject
Set l_ts = fso.CreateTextFile(szCommandText, True)
l_ts.WriteLine ("ftp")
l_ts.WriteLine ("ftp")
l_ts.WriteLine ("cd /mydir")
l_ts.WriteLine ("put my_ftp_file")
l_ts.WriteLine ("quit")
l_ts.Close

Shell "ftp -s:" & szCommandText & " my.server.com ", vbHide

Cheers,
---
Tetsuys Oguma, Sydney, Australia

"Tetsuya Oguma" wrote:

Hi,

How about using Shell command like this?

Shell "ftp -s: myfile myserver", vbHide

Cheers,

"GJones" wrote:

Could you tell me how to do a Ftp from VBA in Excel. I
need to pass the user name and password so I will not be
prompted.

Thanks,

Greg

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Ftp From Excel

Hi again,

The first line of text being username and the second password.

l_ts.WriteLine ("ftp") <- username
l_ts.WriteLine ("ftp") <- password


Sorry for pestering you!

"Tetsuya Oguma" wrote:

Oooops,

I forgot to tell you important bit.

Typically we create a file that includes parameters being passed to FTP
command. So, first create a text file and pass that as parameter of FTP
command, something like:

Dim l_fso As Scripting.FileSystemObject
Dim l_ts As Scripting.TextStream
dim szCommandText as String
szCommandText = "C:\my_command_text.txt"

Set l_fso = New Scripting.FileSystemObject
Set l_ts = fso.CreateTextFile(szCommandText, True)
l_ts.WriteLine ("ftp")
l_ts.WriteLine ("ftp")
l_ts.WriteLine ("cd /mydir")
l_ts.WriteLine ("put my_ftp_file")
l_ts.WriteLine ("quit")
l_ts.Close

Shell "ftp -s:" & szCommandText & " my.server.com ", vbHide

Cheers,
---
Tetsuys Oguma, Sydney, Australia

"Tetsuya Oguma" wrote:

Hi,

How about using Shell command like this?

Shell "ftp -s: myfile myserver", vbHide

Cheers,

"GJones" wrote:

Could you tell me how to do a Ftp from VBA in Excel. I
need to pass the user name and password so I will not be
prompted.

Thanks,

Greg

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"