title: Getting data from HTML source in VBA (excel)
body: <p>I'm trying to collect data from a website, which should be manageable once the source is in string form. Looking around I've assembled some possible solutions but have run into problems with all of them:</p>
  
  <ol>
  <li>Use InternetExplorer.Application to open the url and then access the inner HTML</li>
  <li>Inet</li>
  <li>use Shell command to run wget</li>
  </ol>
  
  <p>Here are the problems I'm having:</p>
  
  <ol>
  <li>When I store the innerHTML into a string, it's not the entire source, only a fraction</li>
  <li>ActiveX does not allow the creation of the Inet object (error 429)</li>
  <li>I've got the htm into a folder on my computer, how do I get it into a string in VBA?</li>
  </ol>
  
  <p>Code for 1:</p>
  
  <p>Sub getData()
      Dim url As String, ie As Object, state As Integer
      Dim text As Variant, startS As Integer, endS As Integer</p>
  
  <pre><code>Set ie = CreateObject("InternetExplorer.Application")
  ie.Visible = 0
  
  url = "http://www.eoddata.com/stockquote/NASDAQ/AAPL.htm"
  ie.Navigate url
  
  
  state = 0
  Do Until state = 4
      DoEvents
      state = ie.readyState
  Loop
  
  
  text = ie.Document.Body.innerHTML
  startS = InStr(ie.Document.Body.innerHTML, "7/26/2012")
  endS = InStr(ie.Document.Body.innerHTML, "7/25/2012")
  
  
  text = Mid(ie.Document.Body.innerHTML, startS, endS - startS)
  
  MsgBox text
  </code></pre>