title: Convert Html String into HTMLDocument VBA
body: <p>I'm writing a macro to grab the current exchange rate from yahoo but I'm having trouble converting a html string into a HTMLDocument to allow me to search for the required element by id. Here is my code so far but it fails on the debug.print line. </p>
  
  <pre><code>Public Sub Forex(currency1 As String, currency2 As String)
  
  Dim oXHTTP As Object
  Dim doc As HTMLDocument
  Dim url As String
  Dim html As String
  Dim id As String
  
  Set oXHTTP = CreateObject("MSXML2.XMLHTTP")
  
  url = "http://finance.yahoo.com/q?s=" &amp; currency1 &amp; currency2 &amp; "=X"
  
  oXHTTP.Open "GET", url, False
  oXHTTP.send
  
  html = oXHTTP.responseText
  Set oXHTTP = Nothing
  
  Set doc = New HTMLDocument
  doc.body.innerHTML = html
  
  id = "yfs_l10_" &amp; currency1 &amp; currency2
  
  Debug.Print doc.getElementById("id").innerText
  
  End Sub
  </code></pre>
  
  <p>What am I missing here?</p>