title: Login into a website and return login status
body: <p>I need to login to a list of website and return login status.</p>
  <p>I am able to do the validate the URL using below VBA code, but I am not sure how to return the login status.</p>
  <p>Script:</p>
  <pre><code>    Function IsURLValid(URL As String) As Boolean
      
  
      
      
      Dim Request As Object
      Dim Result  As String
  
      On Error Resume Next
      
  
      Set Request = CreateObject(&quot;WinHttp.WinHttpRequest.5.1&quot;)
      If Err.Number &lt;&gt; 0 Then
          MsgBox &quot;Could not create the WinHttpRequest object!&quot;, vbCritical, &quot;WinHttpRequest Error&quot;
          Exit Function
      End If
      
   
      Request.Open &quot;GET&quot;, URL, False
      
  
      Request.send
      
     
      Result = Request.StatusText
              
      
      If InStr(1, Result, &quot;OK&quot;, vbTextCompare) &gt; 0 Then IsURLValid = True
      
      
      Set Request = Nothing
  
  End Function
  </code></pre>
  <p><a href="https://i.stack.imgur.com/tI5H5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tI5H5.png" alt="enter image description here" /></a></p>