question

AlfredVachris-7735 avatar image
0 Votes"
AlfredVachris-7735 asked AlfredVachris-7735 commented

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

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

office-vba-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TvanStiphout avatar image
0 Votes"
TvanStiphout answered AlfredVachris-7735 commented

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

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

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

For some unknown reason, the closing paren does not get picked up from the link?

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

Alfred

0 Votes 0 ·
AlfredVachris-7735 avatar image
0 Votes"
AlfredVachris-7735 answered

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?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AlfredVachris-7735 avatar image
0 Votes"
AlfredVachris-7735 answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.