title: Excel VBA get data from web with msxml2.xmlhttp - how do I accept cookies automatically?
body: <p>need your expertise and help, as i've looked around and couldn't find a solution:</p>
  
  <p>I am uploading information to Excel from a website using the msxml2.xmlhttp method (did it earlier via webquery but it gets stuck after a few iterations plus it is slower). My problem is that now on every iteration, I have a Windows Security warning popping up asking me to accept a cookie from the website. Note that the website doesn't require a login/password. I understood from an earlier post that the msxml2.xmlhttp method strips cookies for security reasons, but I get the same message even if I change the method to winhttp. I also changed the settings in IE to accept all cookies automatically from the website but it didn't help. </p>
  
  <p>My question is, what code do I need to add in order to have the cookies be accepted automatically, as I am looping this code on bulk and can't have it hang waiting for me to accept the cookie manually. Your help will be very much appreciated!!! Below is the code snippet (which I actually found here on Stackoverflow). </p>
  
  <pre><code>    Set htm = CreateObject("htmlFile")
  With CreateObject("msxml2.xmlhttp")
      .Open "GET", "http://finance.yahoo.com/q/ae?s=" &amp; Ticker &amp; "+Analyst+Estimates", False
      .send
      htm.body.innerHTML = .responseText
  End With
  Set elemCollection = htm.getElementsByTagName("td")
  For Each itm In elemCollection
      If itm.className = "yfnc_tabledata1" Then
          ActiveCell = itm.innerText
          If ActiveCell.Column = 7 Then
              ActiveCell.Offset(1, -6).Select
          Else
              ActiveCell.Offset(0, 1).Select
          End If
      End If
  Next
  </code></pre>