I implemented some code I found elsewhere on this forum to check for the existence of a remote file.

VB Code:
  1. Public Function IsFileAvailable(ByVal FileLink As String) As Boolean
  2.         Dim objUrl As New System.Uri(FileLink)
  3.         Dim objWebReq As System.Net.WebRequest
  4.         Dim objResp As System.Net.WebResponse
  5.         objWebReq = System.Net.WebRequest.Create(objUrl)
  6.         Try
  7.             objResp = objWebReq.GetResponse
  8.             objResp.Close()
  9.             objWebReq = Nothing
  10.             Return True
  11.         Catch ex As Exception
  12.             objWebReq = Nothing
  13.             Return False
  14.         End Try
  15.     End Function
But if I search for a remote file that I know does not exist, I get a 404 error response and the function bombs out, it does not jump to the Catch? Can anyone see what Im doing wrong?