kbWilliamson
Programmer
I'm trying to automate a FTP transfer of files from a Windows PC into our VMS system via our network. If I use the code below, without the loop counter, the Inet1.StillExecuting never goes "false". If I put in a loop counter to exit the time delay loop and use the message box, it will loop just fine and the files go where I want them. If I leave in the loop counter and take out the message box, it gives a "Still executing" error. This will occure no matter how great the value of the loop counter. When is the "StillExecuting" property supposed to change?
The code is below...please help
Public Sub XferFTP()
Inet1.Protocol = 2 'icFTP
Inet1.URL = "##.#.#.##"
Inet1.UserName = "ANON"
Inet1.Password = "BLIND"
Dim LocalFile As String
Dim RemoteFile As String
Dim CmdStr As String
Dim GoNow As Boolean
Dim I As Long
Dim Marker As String
Marker = "XXXXXXXXXXX" 'Just something to fill the For loop
pintFTPCnt = pintFTPCnt - 1
Do While pintFTPCnt > 0
LocalFile = pstrDayDir & "\" & pstrFTPFile(pintFTPCnt) 'Build file name from array
RemoteFile = pstrFTPFile(pintFTPCnt)
GoNow = False
CmdStr = "SEND " & LocalFile & " " & RemoteFile
Inet1.Execute , CmdStr
Dim Test As Long
Test = 0
Do While GoNow = False
If Inet1.StillExecuting = True Then
For I = 0 To 15000
Marker = Marker
Next
Else
Inet1.Cancel
GoNow = True
End If
If Test >= 5000 then 'This is the loop counter. If not here loop never ends.
GoNow = True
Else
Test = Test + 1
End If
Loop
Inet1.Cancel
pintFTPCnt = pintFTPCnt - 1
MsgBox "Number " & pintFTPCnt & " loaded. Executing is " & Inet1.StillExecuting
' line above shows "Executing is True"
Loop
End Sub
The code is below...please help
Public Sub XferFTP()
Inet1.Protocol = 2 'icFTP
Inet1.URL = "##.#.#.##"
Inet1.UserName = "ANON"
Inet1.Password = "BLIND"
Dim LocalFile As String
Dim RemoteFile As String
Dim CmdStr As String
Dim GoNow As Boolean
Dim I As Long
Dim Marker As String
Marker = "XXXXXXXXXXX" 'Just something to fill the For loop
pintFTPCnt = pintFTPCnt - 1
Do While pintFTPCnt > 0
LocalFile = pstrDayDir & "\" & pstrFTPFile(pintFTPCnt) 'Build file name from array
RemoteFile = pstrFTPFile(pintFTPCnt)
GoNow = False
CmdStr = "SEND " & LocalFile & " " & RemoteFile
Inet1.Execute , CmdStr
Dim Test As Long
Test = 0
Do While GoNow = False
If Inet1.StillExecuting = True Then
For I = 0 To 15000
Marker = Marker
Next
Else
Inet1.Cancel
GoNow = True
End If
If Test >= 5000 then 'This is the loop counter. If not here loop never ends.
GoNow = True
Else
Test = Test + 1
End If
Loop
Inet1.Cancel
pintFTPCnt = pintFTPCnt - 1
MsgBox "Number " & pintFTPCnt & " loaded. Executing is " & Inet1.StillExecuting
' line above shows "Executing is True"
Loop
End Sub