Try ' Delete the file Using loFtpWebResponse As System.Net.FtpWebResponse = loFtpWebRequest.GetResponse() End Using Catch loError As Exception cMessage = cUnableToRenameTheFile + " " + lcURI + " " + oProcess.oLabel.cTo + " " + lcRemoteFileForTheRenameOfTheFile + "." + oApp.cCR + oApp.cCR + loError.Message End TryIn the Catch, loError is not initialized and that causes it.