UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Html Table Output To Vba Array Via Xmlhttp.responsetext, Office 2007    
 
   
kruuth
post Apr 12 2012, 11:20 AM
Post #1

UtterAccess Guru
Posts: 625



I have a large, very large amount of data coming in from a xmlhttp.responseText call. It looks like this:

CODE
<body><table BORDER='1' CELLSPACING='0' style='font-family: Arial; font-size: 8pt'><tr><td>ORDER</td><td>SERIAL</td><td>ID</td><td>STATE</td><td>CITY</td><td>ZIP</td></tr></table></body>


I'm new to this, is there a way to take this output and convert it into a 2d array or something? The output could go as long as 500k lines.
Go to the top of the page
 
+
norie
post Apr 12 2012, 11:35 AM
Post #2

UtterAccess VIP
Posts: 4,295



You'll have to create code to parse the text.
Go to the top of the page
 
+
kruuth
post Apr 12 2012, 11:37 AM
Post #3

UtterAccess Guru
Posts: 625



That's what I thought...but I'm not too sure how to do that. Can I dump it into a string or variant or something? I thought strings could only be so long.
Go to the top of the page
 
+
norie
post Apr 12 2012, 11:57 AM
Post #4

UtterAccess VIP
Posts: 4,295



You could dump into into a string as long as it has less then 2 billion characters.

How did you get the text anyway?
Go to the top of the page
 
+
kruuth
post Apr 12 2012, 12:22 PM
Post #5

UtterAccess Guru
Posts: 625



The text is coming in from xmlhttp.responseText I tried splitting it to a variant array but I get "Object variable or with block variable not set" when I use this:

CODE
Dim linevar() As Variant
Dim splitonval As String
splitonval = "</tr>"
linevar = Split(xmlhttp.responseText, splitonval)


Go to the top of the page
 
+
norie
post Apr 12 2012, 12:41 PM
Post #6

UtterAccess VIP
Posts: 4,295



That isn't how you would declare linevar, you declare it like this.
CODE
Dim linevar As Variant
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th May 2013 - 02:15 PM

Tag cloud: