Click here to Skip to main content
15,744,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a batch file to copy a csv file from a remote server to my desktop which works fine when I execute it.
I want to invoke that batchfile using excel macro which is as follows:

Sub ftp_file()
Dim getfile As Double
getfile = Shell("c:\folder\needtorun.bat", vbNormalFocus)
End Sub
It does not copy the required file to the destination. I have re checked my batchfile and it has no issues when run independently.
One of the possibility could be, exel macro does not wait until the ftp is complete. How can I check at which step the problem is occuring? How can I go about it?

Has anybody tackled the similar issue before? Any help is appreciated.

Thanks in advance!

1 solution

Instead using batch, use FileCopy[^] method.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900