title: excel vba http request download data from yahoo finance
body: <p>I am in the process of making a program I wrote using excel vba faster.</p>
  
  <p>The program downloads stock market data from the asx.</p>
  
  <p>I want to get data from 2 urls:</p>
  
  <p><strong>MY CODE</strong></p>
  
  <pre><code>url2 = "http://ichart.finance.yahoo.com/table.txt?s=bhp.ax"
  
  Set XMLHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
  
  XMLHTTP.Open "GET", url2, False
  
  XMLHTTP.send
  
  result = XMLHTTP.responseText
  
  ActiveCell.Value = result
  
  Set XMLHTTP = Nothing
  
  URL 1. http://ichart.finance.yahoo.com/table.txt?s=bhp.ax
  </code></pre>
  
  <p><strong>MY PROBLEM.</strong></p>
  
  <p>This file is very large. I thought I could simply store the result of these http requests and print it to the debug window or directly to a cell. However these methods seem to be cutting off parts of the data?</p>
  
  <p>if I download the txt file from url 2 in notepad++ it has almost 200 000 characters 
  but it excel it has between 3 -5 000. What is the best way to handle these requests so that all the data is captured and I can parse it all later?</p>
  
  <p>URL 2. from the first URL I only want the JSON data which results from the YQL query. </p>
  
  <p><strong>MY PROBLEM</strong></p>
  
  <p>I am not sure how to get just the json data when you follow the link below, and or how to store it so that the problem experienced with URL 1 (missing data) does not occur.</p>
  
  <p><a href="http://developer.yahoo.com/yql/console/?q=select%20symbol%2C%20ChangeRealtime%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22YHOO%22%2C%22AAPL%22%2C%22GOOG%22%2C%22MSFT%22%29%20|%20sort%28field%3D%22ChangeRealtime%22%2C%20descending%3D%22true%22%29%0A%09%09&amp;env=http%3A%2F%2Fdatatables.org%2Falltables.env#h=select%20" rel="nofollow">http://developer.yahoo.com/yql/console/?q=select%20symbol%2C%20ChangeRealtime%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22YHOO%22%2C%22AAPL%22%2C%22GOOG%22%2C%22MSFT%22%29%20|%20sort%28field%3D%22ChangeRealtime%22%2C%20descending%3D%22true%22%29%0A%09%09&amp;env=http%3A%2F%2Fdatatables.org%2Falltables.env#h=select%20</a>*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22bhp.ax%22%29</p>
  
  <p>Many Thanks, Josh.</p>