title: Importing web data
body: <p>I trying to import web data to excel using vba with below code but it seems like not working.Hopefully someone can help to fix this issue, thank you very much!</p>
  
  <pre><code>Sub ExchangeRate()
  Dim ieObj As InternetExplorer
  Dim htmlEle As IHTMLElement
  Dim i As Integer
  
  i = 1
  
  Set ieObj = New InternetExplorer
  ieObj.Visible = True
  ieObj.navigate "https://www.imf.org/external/np/fin/ert/GUI/Pages/Report.aspx?CU=%27SGD%27&amp;EX=REP&amp;P=OneWeek&amp;CF=Compressed&amp;CUF=Period&amp;DS=Ascending&amp;DT=Blank"
  
  Application.Wait Now + TimeValue("00:00:05")
  
  For Each htmlEle In ieObj.document.getElementsByClassName("default").Item(2).getElementsByClassName("row1").Item(4)
      With ActiveSheet
        .Range("A" &amp; i).Value = htmlEle.Children(0).textContent
        .Range("B" &amp; i).Value = htmlEle.Children(1).textContent
        .Range("C" &amp; i).Value = htmlEle.Children(3).textContent
        .Range("D" &amp; i).Value = htmlEle.Children(4).textContent
      End With
  
      i = i + 1
  
  Next htmlEle
  
  End Sub
  </code></pre>