Shell and Command Prompt Question

F

Fred***

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***
 
G

Greg Koppel

Hi Fred,

It's not that Excel is killing the ftp session, it just continues running
code without waiting for the end of the shell command. At a place I used to
work at, we got around this by separating the macro so that the first macro
ends with the shell function and the second macro doesn't start until it
successfully checks for a condition that the shell function is complete.

HTH, Greg
 

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