I get a runtime error 20302 - Interrupted just after the characters are sent out the serial port and before I begin the FTP part of this:
Private Sub Command4_Click()
Set fso = New FileSystemObject
For Each fFile In fso.GetFolder(firstholdpath).Files
fso.CopyFile firstholdpath + fFile.Name, secondholdpath, True
Serial.CommPort = Val(comport)
Serial.PortOpen = True
Serial.Output = "CORRECTIONS" & vbCr
Serial.PortOpen = False
logentry = "CORRECTIONS-2 sent out serial port - COM2": Call logit
FTP1.RemoteHost = host
FTP1.TransferMode = 1
FTP1.LocalFile = firstholdpath + fFile.Name
FTP1.RemoteFile = fFile.Name
FTP1.User = username
FTP1.password = password
FTP1.Action = 2
FTP1.Action = 5
FTP1.Action = 3
logentry = fFile.Name + " was ftp'd a SECOND time to " + FTP1.RemoteHost: Call logit
Kill firstholdpath + fFile.Name
Next
savedtime = DateAdd("n", 30, Now)
secondsavedtime = DateAdd("n", 10, Now)
Label4.Caption = "Third Transfer Time: " & secondsavedtime
Label3.Caption = ""
End Sub
Does anyone know why? I am using all of the same variables without error earlier in the program.
Thanks for the help.
Mindy
Private Sub Command4_Click()
Set fso = New FileSystemObject
For Each fFile In fso.GetFolder(firstholdpath).Files
fso.CopyFile firstholdpath + fFile.Name, secondholdpath, True
Serial.CommPort = Val(comport)
Serial.PortOpen = True
Serial.Output = "CORRECTIONS" & vbCr
Serial.PortOpen = False
logentry = "CORRECTIONS-2 sent out serial port - COM2": Call logit
FTP1.RemoteHost = host
FTP1.TransferMode = 1
FTP1.LocalFile = firstholdpath + fFile.Name
FTP1.RemoteFile = fFile.Name
FTP1.User = username
FTP1.password = password
FTP1.Action = 2
FTP1.Action = 5
FTP1.Action = 3
logentry = fFile.Name + " was ftp'd a SECOND time to " + FTP1.RemoteHost: Call logit
Kill firstholdpath + fFile.Name
Next
savedtime = DateAdd("n", 30, Now)
secondsavedtime = DateAdd("n", 10, Now)
Label4.Caption = "Third Transfer Time: " & secondsavedtime
Label3.Caption = ""
End Sub
Does anyone know why? I am using all of the same variables without error earlier in the program.
Thanks for the help.
Mindy