title: Handle lack of internet connection in Visual Basic for Applications
body: <p>I am creating simple code which goes to a website, clicks on a login button, enters login details etc., and downloads data. I know this is not a recommended method, but using <code>Microsoft.XMLHTTP</code> where I <code>GET</code> the URL doesn't help as the URL of the page I finally reach, after login, has a unique authentication token generated. E.g. yesterday, <code>URL = www.abcd.com/ABCD-EFGH-IJKL</code> and today it is <code>URL = www.abcd.com/MNOP-QRST-UVWX</code>, so I don't have a set URL.
  Therefore, with the <code>InternetExplorer.Application</code> method, I am trying to handle disconnections from the internet. Being disconnected from the internet, does not generate an error, but merely a blank page, so I can't use <code>On Error GoTo LineX</code>. How do I go about handling a disconnection in a code such as:</p>
  
  <pre><code>Dim IE as Object
  Set IE = CreateObject (InternetExplorer.Application")
  IE.navigate "www.abcd.com"
  If 'some sort of status response' = 'some value' Then Msgbox 'You are disconnected from the internet'
  Else
  End If
  </code></pre>
  
  <p>Is there a status response code (as there is with <code>Microsoft.XMPHTTP</code>) which I can use to inform user with msgbox that "Please connect to the internet etc."?</p>
  
  <p>Thank you.</p>