D
Dave Hawks
I use the following code to upload an html file to a website triggered at
regular intervals by the on timer property of a form.
This works OK until for any reason the website cannot be reached when I get
a runtime error which halts the routine until the error message is cleared
manualy.
Is there any way of automatically accepting the message and simply closing
the form so that it will try again on the next timer event.
Private Sub Form_Timer()
Dim objFTP As InetTransferLib.ftp
Const conTARGET = "ftp://ftp.*******"
Set objFTP = New InetTransferLib.ftp
With objFTP
.FtpURL = conTARGET
.SourceFile = "C:/WebsiteUploads/repToday.html"
.DestinationFile = "/*******"
.AutoCreateRemoteDir = True
If Not .IsConnected Then .DialDefaultNumber
.ConnectToFTPHost "userid", "passwd"
.UploadFileToFTPServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)
regular intervals by the on timer property of a form.
This works OK until for any reason the website cannot be reached when I get
a runtime error which halts the routine until the error message is cleared
manualy.
Is there any way of automatically accepting the message and simply closing
the form so that it will try again on the next timer event.
Private Sub Form_Timer()
Dim objFTP As InetTransferLib.ftp
Const conTARGET = "ftp://ftp.*******"
Set objFTP = New InetTransferLib.ftp
With objFTP
.FtpURL = conTARGET
.SourceFile = "C:/WebsiteUploads/repToday.html"
.DestinationFile = "/*******"
.AutoCreateRemoteDir = True
If Not .IsConnected Then .DialDefaultNumber
.ConnectToFTPHost "userid", "passwd"
.UploadFileToFTPServer
End With
ExitHere:
On Error Resume Next
Set objFTP = Nothing
Call SysCmd(acSysCmdRemoveMeter)