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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
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
 
Upvote 0
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
%>
 
Upvote 0
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
%>
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,215
Members
448,874
Latest member
b1step2far

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
Back
Top