Has the functionality of CreatObject("Microsoft.XMLHTTP") changed? Its no longer returning the complete page source string?

Alfred Vachris 21 Reputation points
2021-06-08T16:04:38.87+00:00

This is the snippet of VBA code that I am using to capture the result of a Google search.

With CreateObject("Microsoft.XMLHTTP") 'this will return the complete colletion of characters
.Open "GET", This_Search_String_URL, False
.Send
This_Search_Result_String = .responseText
End With
In the past, it always returned the complete page source string.
It's not working for me now?
Regards
Alfred

Developer technologies Visual Basic for Applications
0 comments No comments
{count} votes

Accepted answer
  1. Tom van Stiphout 1,861 Reputation points MVP Volunteer Moderator
    2021-06-08T18:25:47.76+00:00

    You're grabbing the data before the page is fully loaded. You need to wait for readystate.

    https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ms753702(v=vs.85)


2 additional answers

Sort by: Most helpful
  1. Alfred Vachris 21 Reputation points
    2021-06-08T18:39:43.63+00:00

    Great
    Thanks for the insight!
    Thank you, that is a big help!
    I have an Excel/VBA project that passes a collection of search strings to Google and then aggregates the unique results.
    The process just died recently and I did not know what was wrong.
    Best Regards
    Alfred

    by the way, the link you posted does not work?
    So what do I need to do to ensure that the query has reached a ready state?

    0 comments No comments

  2. Alfred Vachris 21 Reputation points
    2021-06-08T18:47:05.56+00:00

    Sorry
    The link address in the email that I received works!
    https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ms753702(v=vs.85)
    but the link in on the Docs site did not work?
    Alfred

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.