Hi all... me again!!
I am having trouble catching (or ignoring!) an error... Thsi is my code
So... my problem is that I want to ignore the file that is trying to be deleted if it does not exist, but I DO want to detect errors on the FTP part. There is celarly a conflict here as the on error line detects there is no file for the kill command and jumps stright to the upload errors ignoring the FTP get...Code:'GET THE NEWS ROUTINE Private Sub getnews() On Error GoTo UploadError Inet1.AccessType = icUseDefault Inet1.URL = myftp Inet1.UserName = myusername Inet1.Password = mypassword Inet1.RequestTimeout = 40 MsgBox "before kill" Kill "c:\news.mp3" ' DELETE FILE BEFORE UPLOAD MsgBox "before get" Inet1.Execute , "get " & FileName & " " & destinationfolder & " " & FileName ' D/L FILE MsgBox "after get" Do While Inet1.StillExecuting DoEvents Loop Inet1.Execute , "CLOSE" ' CLOSE FTP CONNECTION UploadError: err_defined = "no" If Err.Number = "0" Then serverresult = "File downloaded correctly" If Err.Number = "35754" Then serverresult = "Unable to upload file, check password" If Err.Number = "35764" Then MsgBox "Server busy, please wait", , "Server Message" If Err.Number = "35752" Then MsgBox "Server Configuration Error, Check Config file", , "Server Message" If Err.Number = "12014" Then Beep End Sub
Help?




Reply With Quote