title: Timing out a function/command
body: <p>I found the bit of code below and have altered it for my use, the only problem is that if the website does not give a failed return or success the code never ends. (IE if the site is hanging) </p>
  
  <p>is there any way to set a time out after the "HttpRequest.send" command. so if after 30 seconds there is no response it marks it as failed and moves on? </p>
  
  <pre><code>     Set HttpRequest = CreateObject("Msxml2.XMLHTTP") 
     HttpRequest.open "HEAD", "http://example.com/", False 
     On Error Resume Next 
     HttpRequest.send 
     If Err.Number &lt;&gt; 0 Then 
       WScript.Echo "Error : " &amp; Err.Number &amp; ": " &amp; Err.Description 
     Else 
       WScript.Echo "HTTP status: " &amp; HttpRequest.status &amp; " " _ 
        &amp; HttpRequest.statusText 
     End If 
  </code></pre>
  
  <p>cheers</p>
  
  <p>OH this is VBA </p>
  
  <p>Aaron </p>