I know questions like this have been asked before, but mine is a bit different and has been fairly troubling. What I\'m dealing with is a web page with a form with a few ev
Old question I know, but I think this is a good answer that I haven't seen about much...
I had a similar problem; waiting for all the images on a google image search to load (which is a tricky thing since image loads are prompted by AJAX and the user scrolling the page). As has been suggested in the comments; my solution was to wait for a certain element to appear in the viewport (this is an area a little larger than the monitor screen, and is treated as what you can actually "see").
This is achieved with the getBoundingClientRect method
Dim myDiv As HTMLDivElement: Set myDiv = currPage.getElementById("fbar")
'myDiv should some element in the page which will only be visible once everything else is loaded
Dim elemRect As IHTMLRect: Set elemRect = myDiv.getBoundingClientRect
Do Until elemRect.bottom > 0 'If the element is not in the viewport, then this returns 0
DoEvents
'Now run the code that triggers the Ajax requests
'For me that was simply scrolling down by a big number
Set elemRect = myDiv.getBoundingClientRect
Loop
myDiv.ScrollIntoView
I explain in detail in the linked answer how this works, but essentially the BoundingClientRect.bottom is equal to 0 until the element is in the vieport.
The element is something which is loaded straight away (like a frame/template for the page). But you don't actually see it until all the content has been loaded, because it's right at the bottom.
If that element is indeed the last thing to be loaded (for my google search it was the Show More Results button), then as long as you get it into the viewport when it's loaded, you should be able to detect when it appears on the page. .bottom then returns a non-zero value (something to do with the actual position of the element on the page - I didn't really care though for my purposes). I finish off with a .ScrollIntoView, but that's not essential.