title: Excel VBA WinHttpRequest saved Credentials
body: <p>I wrote the following code to get the innerHTML text of a website:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Public Function GetInnerHtmlBody(ByVal Url As String) As HTMLDocument
      Dim ResponseDocument As New HTMLDocument
  
      Dim MyRequest As New WinHttpRequest
      With MyRequest
          .SetTimeouts 5000, 5000, 5000, 5000
          .SetProxy HTTPREQUEST_PROXYSETTING_PROXY, "&lt;PROXY_SERVER_IP&gt;:&lt;PORT&gt;", "*.domain.com"
  
          .Open "GET", Url, False
  
          '// Authentication for the proxy server
          '.SetCredentials "&lt;USERNAME&gt;", "&lt;PASSWORD&gt;", CREDENTIALS_FOR_PROXY
  
          .Send
  
          '// Debug
          MsgBox .ResponseText, vbInformation, .StatusText &amp; " - " &amp; .Status
  
          ResponseDocument.body.innerHTML = .ResponseText
      End With
  
      Set GetInnerHtmlBody = ResponseDocument
  End Function
  </code></pre>
  
  <p>As you can see the line <code>.SetCredentials</code> is commented out. This line was only needed once to authenticate with the proxy server but now it seems like the login credentials were saved, because even if i exlude the row the code successfully retrieves the html code of the given website.</p>
  
  <p>I restartet my computer and cleared the whole IE cache but the code still works.</p>
  
  <ol>
  <li><p>My question is now where are the <code>Credentials</code> saved? Coockie?</p></li>
  <li><p>Is there a way that the HttpRequest uses the IE proxy settings? -> No need of asking for Username and Password.</p></li>
  </ol>