Hi,
I am using the following code to call a batch file which automatically FTP's a txt file to the local drive. The FTP process takes about 5 seconds to run, and the code directly afterwards is already looking for the file before it has actually arrived.
Can anyone help me with a 'wait' command here, or suggest something similar? Here's the code;
Cheers
I am using the following code to call a batch file which automatically FTP's a txt file to the local drive. The FTP process takes about 5 seconds to run, and the code directly afterwards is already looking for the file before it has actually arrived.
Can anyone help me with a 'wait' command here, or suggest something similar? Here's the code;
Code:
Call Shell("c:\import\IMPORT.bat", vbNormalFocus)
ChDir "C:\Import"
Workbooks.OpenText Filename:="C:\Import\report_file.txt", Origin:=xlWindows _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array( _
32, 1), Array(84, 1))
Cheers