I have code that works to load a HTMLTable, but I recently had a large list and realized it was only pulling the top of the list. Further investigation watching dev console shows multiple "post" requests as I scroll down the table in the browser. I'm debating building code (if I even can) to try and find the last item in the table, and then run the query again, but I wanted to see if I could tackle the root problem "correctly" vs hacking around it.
How can I perhaps simulate scrolling and monitor post requests or any other suggestions?
Here is some sample code, but I can't unfortunatley share the link as its LAN access only. Note: No login in required, but I couldn't figure out how to do it without using an IE Object to generate the cookie that goes along w/ the request (couldn't post via CLI).
Do Until InStr(1, IEObj.document.getElementById("gbox_tbl").innerHTML, "WAREHOUSE") > 0
DoEvents
Loop
Dim table As MSHTML.HTMLTable, HTMLCollection As IHTMLElementCollection
Set table = IEObj.document.getElementById("gbox_tbl")
Set ClipBoard = New MSForms.DataObject
Application.Wait (Now() + TimeValue("00:00:01"))
ClipBoard.SetText table.outerHTML
ClipBoard.PutInClipboard
Dim TempWS As Worksheet
Call WorksheetCreateDelIfExists("TempSheet")
Set TempWS = Worksheets("TempSheet")
TempWS.Activate
Range("A1").Select
ActiveSheet.Paste
'Stop
Dim UsedRng As Range
Set UsedRng = GetUsedRange(TempWS)
UsedRng.Copy
Dim FindSMPDestWS As Worksheet, wss As Worksheet, SearchTerm As String, i As Integer
i = 0
SearchTerm = "FindWSR"
For Each wss In ActiveWorkbook.Worksheets
If Left(wss.Name, Len(SearchTerm)) = SearchTerm Then
i = i + 1
End If
Next wss
If i = 0 Then
Call WorksheetCreate("FindWSR")
Else
Call WorksheetCreate("FindWSR(" & i & ")")
End If
Set FindSMPDestWS = ActiveSheet
FindSMPDestWS.Activate
Range("A1").Select
FindSMPDestWS.Paste
If Range("A1") <> "Loading..." Then
Application.Wait (Now() + TimeValue("00:00:01"))
ClipBoard.SetText table.outerHTML
ClipBoard.PutInClipboard
Range("A1").Select
FindSMPDestWS.Paste
End If