T
tx12345
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
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