title: get specific table into excel using VBA
body: <p>I am looking for a way to get a table into excel using VBA. Using a web query is not suitable for specific reasons. </p>
  
  <p>So far i have got this</p>
  
  <pre><code>Set ie = CreateObject("InternetExplorer.Application")
  ie.Navigate "http://bmreports.com/servlet/com.logica.neta.bwp_PanBMUTop"
  ie.Visible = True
  While ie.Busy
  DoEvents
  Wend
  ie.document.getelementbyid("param5").Value = "2014-04-12"
  ie.document.getelementbyid("param6").Value = "8"
  ie.document.getelementbyid("go_button").Click
  </code></pre>
  
  <p>The web page that opens has a table within it called Maximum Export Limit - half way down the page and on the left hand side.</p>
  
  <p>I found the part of the html code that is responsible for the table and manged to copy the inner html to the web page manually (just copy and pasting) however how do i do this via VBA></p>
  
  <p>@Ron
  So far i have this in all</p>
  
  <pre><code>Sub DataStuff()
  Dim ie As Object
  
  Set ie = CreateObject("InternetExplorer.Application")
  ie.Navigate "http://bmreports.com/servlet/com.logica.neta.bwp_PanBMUTop"
  ie.Visible = True
  While ie.Busy
  DoEvents
  Wend
  ie.Document.getelementbyid("param5").Value = "2014-04-12"
  ie.Document.getelementbyid("param6").Value = "8"
  ie.Document.getelementbyid("go_button").Click
  
  Set objShell = CreateObject("Shell.Application")
  IE_count = objShell.Windows.Count
  For x = 0 To (IE_count - 1)
      On Error Resume Next    ' sometimes more web pages are counted than are open
      my_url = objShell.Windows(x).Document.Location
      my_title = objShell.Windows(x).Document.Title
  
      If my_url Like "http://bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet" Then
          Set ie = objShell.Windows(x)
  </code></pre>
  
  <p>table_html = ie.Document.getElementsByTagName("tbody")(2).innerhtml</p>
  
  <pre><code>Worksheets("Sheet1").Activate
  Range("A1").Select
  ActiveCell = table_html
          Exit For
      Else
      End If
  
  
  
  
  
  
  
  
  
  Next
  
  
  
  
  
  End Sub
  </code></pre>