title: GetElementsbyClassname: Open IE vs. MSXML2 Methods
body: <p>The following macro works just fine.  It opens an instance of IE and uses the "getelementsbyclassname" method to return the expected value for "my_rate".  However when I run the second macro which uses the "MSXML2" method, the macro fails on the noted line and a "Run-time error 438: Object doesn't support this property or method" error occurs.  Why does the "Open IE" method work, but the "MSXML2" method fail with my code?  I am running with IE 11.  I also have a reference set to the Microsoft HTML Object Library for the second macro, but it doesn't seem to make a difference.  Thanks in advance for explaining this to me.</p>
  
  <pre><code>Sub BankRate_Rate_Retrieval()
      my_url = "http://www.bankrate.com/funnel/mortgages/mortgage-results.aspx?market=321&amp;loan=150000&amp;perc=20&amp;prods=2&amp;points=0"   
      Set ie = CreateObject("InternetExplorer.Application")
  
      With ie
          .Visible = True
          .Navigate my_url
          .Top = 50
          .Left = 530
          .Height = 400
          .Width = 400
      End With
  
      Do Until Not ie.Busy And ie.readyState = 4
          DoEvents
      Loop
  
      my_rate = ie.Document.getelementsbyclassname("br-col-2 br-apr")(1).getElementsByTagName("div")(0).innertext
  End Sub
  
  
  Sub BankRate_Rate_Retrieval()
      my_url = "http://www.bankrate.com/funnel/mortgages/mortgage-results.aspx?market=321&amp;loan=150000&amp;perc=20&amp;prods=2&amp;points=0"
      Set html_doc = CreateObject("htmlfile")
      Set xml_obj = CreateObject("MSXML2.XMLHTTP")
  
      xml_obj.Open "GET", my_url, False
      xml_obj.send
      html_doc.body.innerhtml = xml_obj.responseText
      Set xml_obj = Nothing
  
      my_rate = html_doc.body.getelementsbyclassname("br-col-2 br-apr")(1).getElementsByTagName("div")(0).innertext
  </code></pre>
  
  <p>' Run-time error 438: Object doesn't support this property or method occurs on above line   </p>
  
  <p>End Sub</p>
  
  <p>Edit: Library Screenshot for D. Zemens</p>
  
  <p><img src="https://i.stack.imgur.com/6tavI.jpg" alt="enter image description here"></p>