RE: XML Expert needed

philhowell

Board Regular
Joined
Jun 11, 2002
Messages
175
Hi all,

not really an excel quetion, but thought some Guru on here might have some pointers....

i'm using the XML Object XMLHTTP

Server.CreateObject("Microsoft.XMLHTTP")

to get data from another web server, but evry now and again when it tries to print the data i get a '8000000a' error...

i've looked up 8000000a on the MSDN and it says it's because the data isn't availible...???

i can only guess this is because it hasn't retrieved the external data by the time it compiles it XMLHTTP Object...

i've tried stalling the response.write, but that doesn't seem to help...

any suggestions....

Cheers
Phil
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

ChrisUK

Well-known Member
Joined
Sep 3, 2002
Messages
675
Can you show the code please.

I've been using this object to get yahoo stocks information and it's been OK even with really long pages.

It is IE specific, what version of IE are you running ? try upgrading to the latest version (I'm on 5.5 with no problems)

Chris
 

philhowell

Board Regular
Joined
Jun 11, 2002
Messages
175
Hiya,

I'm using IE6, and it seems to work 9 out of 10 times...

the variable qrySearch is passed through the URL via a form txtbox named search....




<%

Dim qrySearch
Dim objXMLHTTP, xml

qrySearch = Request.QueryString("search")
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=" & qrySearch

' Pull the data from the web page
xml.Send

Response.write "Here's the html we now have in our xml object"
Response.write "


"
Response.Write "<xmp>"

Response.Write xml.responseText
Response.Write "</xmp>"
Response.write "


"
Response.write " Now here's how the page looks:

"
Response.Write xml.responseText


Set xml = Nothing
%>
 

philhowell

Board Regular
Joined
Jun 11, 2002
Messages
175
Sorry forgot to disable the HTML on the last post, so it tried to run it... here is the code snippet, it basically queries google and displays the search results...


<%

Dim qrySearch
Dim objXMLHTTP, xml

qrySearch = Request.QueryString("search")
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=" & qrySearch

' Pull the data from the web page
xml.Send

Response.write "Here's the html we now have in our xml object"
Response.write "


"
Response.Write "<xmp>"

Response.Write xml.responseText
Response.Write "</xmp>"
Response.write "


"
Response.write " Now here's how the page looks:

"
Response.Write xml.responseText


Set xml = Nothing
%>
 

ChrisUK

Well-known Member
Joined
Sep 3, 2002
Messages
675
Looks OK to me, one thing you could try is to use POST and not GET

Chris
 

Forum statistics

Threads
1,143,640
Messages
5,719,986
Members
422,256
Latest member
downeybm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top