title: MSXML2.XMLHTTP times out once in a while
body: <p>Trying to determine if a file exists on the server using an MSXML2.XMLHTTP request. It works most of the time but every once in a while fails with "Operation timed out". At most, there error condition kicks in once and theh it returns to working normally. Any ideas?</p>
  
  <pre><code> Public Function InputFileThere(myUrl As String) As Boolean
   Dim myLine As String
   Dim numTimes As Long
   Dim MyRequest As Object
   Dim urlExists As Boolean
   numTimes = 0
   urlExists = False
   Dim dirName As String
   Dim userName As String
   Dim passWord As String
   userName = “******”
   passWord = “******”
   On Error GoTo errorPart
   startHere:
   Set MyRequest = CreateObject("MSXML2.XMLHTTP")
   MyRequest.Open "HEAD", myUrl, False, userName, passWord
   MyRequest.send
   If MyRequest.StatusText = "OK" Then urlExists = True
   GoTo finHere
   errorPart:
   Set MyRequest = Nothing
   numTimes = numTimes + 1
   myLine = " Right now " &amp; Format(Now(), "hh:mm:ss") &amp; " there was an error , numTimes = " &amp;    CStr(numTimes) &amp; " Err Description = " &amp; Err.Description
  Application.StatusBar = myLine
  Application.Wait (Now() + TimeValue("00:01:00"))
  GoTo startHere
  finHere:
  InputFileThere = urlExists
  Set MyRequest = Nothing
  End Function
  </code></pre>