View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tx12345[_10_] tx12345[_10_] is offline
external usenet poster
 
Posts: 1
Default Importing Html Source Part 2


A poster came up with this nice bit of code, but it seems if the source
code goes past 300 lines, it loops the first 300 lines several times:


Code:
--------------------


Sub Tester()
Range("a1").Value = GetSource("http://thewebpageyou wanthere")
End Sub


Function GetSource(sURL As String) As String

Dim oXHTTP As Object

Set oXHTTP = CreateObject("MSXML2.XMLHTTP")
oXHTTP.Open "GET", sURL, False
oXHTTP.send
GetSource = oXHTTP.responsetext
Set oXHTTP = Nothing

End Function

Code:
--------------------


Also, note that A1 is the cell designated to receive the text. The code above attempts to place all the source into a single cell, which I think creates the problem. A smaller web page is manageable, but if the code goes too far past 300 lines then you run into this strange 'looping' thing mentioned above.

Is there some way to adjust that code to flow the source into the entire worksheet instead of stopping inside of one cell?

Thx


--
tx12345
------------------------------------------------------------------------
tx12345's Profile: http://www.excelforum.com/member.php...o&userid=24776
View this thread: http://www.excelforum.com/showthread...hreadid=503726