View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Shell and Command Prompt Question

And if you want your code to wait for the FTP to finish...

http://support.microsoft.com/?kbid=214248
XL2000: How to Force Macro Code to Wait for Outside Procedure

Here's a link to a nice ShellAndWait function that does that.
http://groups.google.com/groups?thre...%40tkmsftngp03



Fred*** wrote:

I am shelling to the Command Prompt and executing an FTP connection with
switches like this:
x = Shell("ftp -i -s:ftp_input_script ftp_server_namek)

The ftp_input_script fetches a file from the ftp server, then exits.
The last command in the ftp_input_script is "bye".

My problem is that Excel seems to kill the ftp session before a proper "bye"
is completed, even when I put wait routines after shelling.

Is there a way to send a "bye" command to the FTP session from Excel?
I'm thinking that I can keep the FTP sessoin open, verify that the file
downloaded correctly, and then kill the ftp session.

Fred***


--

Dave Peterson