title: Catching Timeout on VBA WinHttpRequest
body: <p>I want to set Timeout values and catch this event if it happens using VBA and Excel. So far I tried with XMLHTTP60 and WinHttpRequest:</p>
  
  <pre><code>    Set XMLHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
      With XMLHTTP
          .setTimeouts 11, 11, 11, 11 'Values for testing to get a timeout
          '.setTimeouts TIMEOUT_LRESOLVE, TIMEOUT_LCONNECT, TIMEOUT_LSEND, TIMEOUT_LRECEIVE
          .Open "GET", currenturl, False
          .send
          '.waitForResponse 1 'testing
          If .responseText Like "*PATH_NOT_FOUND*" Or .responseText Like "*OUTSIDE_BOUNDS*" Then
              noroutefound = True
              GoTo skiploop
          End If
          str = Split(.responseText, "{""startTime"":")
          complstr = .responseText
      End With
  </code></pre>
  
  <p>However, I am unable to catch an Error caused by a Timeout, or a Timeout itself.</p>
  
  <p>How can I catch a Timeout?</p>