I'm using VBA to automate Internet Explorer as a means of pulling some data off the web for my database. The problem I've been having is that some of the data is loaded asynchronously with AJAX and the data is often still loading after the page has loaded (ie.readyState = READYSTATE_COMPLETE).

Is there a way I can halt execution of my VBA code until Explorer finishes asynchronously loading the data I need? In other words, is there a way I can detect when all the Javascript in the page is done executing? Right now I'm just delaying the program for an inordinate amount of time to be sure all the data is there to be read but it's not a very good, reliable solution.



Thanks in advance!