title: Performance of scrappping WEB table in VBA Excel
body: <p>This code is too slow. I need to transfer data from HTML table to excel worksheet. I can't use query table because the table is generated by POST method after pressing a button.
  The table is 16 columns x 200+ rows</p>
  <p>What can I do to make it work faster?</p>
  <pre><code>'GET THE TABLE
  Dim HTMLTables As MSHTML.IHTMLElementCollection
  Dim HTMLTable As MSHTML.IHTMLElement
  Dim HTMLDiv As MSHTML.IHTMLElement
  Dim TableSection As MSHTML.IHTMLElement
  Dim TableRow As MSHTML.IHTMLElement
  Dim TableCell As MSHTML.IHTMLElement
  Dim RowText As String
  Dim row As Integer
  Dim column As Integer
  
  Dim ws As Worksheet
  Set ws = Workbooks(&quot;Zautomatyzowany raport produkcyjny.xlsm&quot;).Worksheets(&quot;PressQualityHold&quot;)
  
  row = 1
  column = 1
  'WAIT for IE
  Do While IE.readyState &lt;&gt; READYSTATE_COMPLETE Or IE.Busy
  Loop
  
  
  Set HTMLTables = HTMLDoc.getElementsByTagName(&quot;table&quot;)
  
  Workbooks(&quot;Zautomatyzowany raport produkcyjny.xlsm&quot;).Worksheets(&quot;PressQualityHold&quot;).Cells.Clear
  
  For Each HTMLTable In HTMLTables
      'Debug.Print HTMLTable.ID, HTMLTable.className
      
      If HTMLTable.ID = &quot;table_details&quot; Then
          For Each TableSection In HTMLTable.Children
              'Debug.Print , TableSection.tagName
              
                  If TableSection.tagName = &quot;TBODY&quot; Then
                      For Each TableRow In TableSection.Children
                          'RowText = &quot;&quot;
                          For Each TableCell In TableRow.Children
                              ws.Cells(row, column).Value = TableCell.innerText
                              'RowText = RowText &amp; vbTab &amp; TableCell.innerText
                              column = column + 1
                          Next TableCell
                          'Debug.Print , , RowText
                          row = row + 1
                          column = 1
                      Next TableRow
                  End If
                  
          Next TableSection
      End If
      
  Next HTMLTable
  
  IE.Quit
  </code></pre>