I know how to do the basic:
open "c:\file.txt" for Input As #1
is it possible to open a web site for text input, and read the html code
as text into VBA? What would the format for the filename be?
Thanks so much in advance!
Joey
I know how to do the basic:
open "c:\file.txt" for Input As #1
is it possible to open a web site for text input, and read the html code
as text into VBA? What would the format for the filename be?
Thanks so much in advance!
Joey
Function GetSource(sURL) As String
Dim xmlhttp As Object
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
onerror goto haveError
xmlhttp.Open "GET", sURL, False
xmlhttp.send
GetSource = xmlhttp.responseText
Exit Function
haveError:
GetSource = "Error: " & Err.Description
End Function
Sub test()
MsgBox GetSource("http://www.google.com")
End Sub
Tim
"Joey Lichtenstein" <[email protected]> wrote in message
news:[email protected]...
>
> I know how to do the basic:
>
> open "c:\file.txt" for Input As #1
>
> is it possible to open a web site for text input, and read the html code
> as text into VBA? What would the format for the filename be?
>
> Thanks so much in advance!
>
> Joey
>
Thanks Tim!
This Works PERFECT!!!!
Tim Williams <timjwilliams at gmail dot com> wrote:
: Function GetSource(sURL) As String
: Dim xmlhttp As Object
: Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
: onerror goto haveError
: xmlhttp.Open "GET", sURL, False
: xmlhttp.send
: GetSource = xmlhttp.responseText
: Exit Function
: haveError:
: GetSource = "Error: " & Err.Description
: End Function
: Sub test()
: MsgBox GetSource("http://www.google.com")
: End Sub
: Tim
: "Joey Lichtenstein" <[email protected]> wrote in message
: news:[email protected]...
:>
:> I know how to do the basic:
:>
:> open "c:\file.txt" for Input As #1
:>
:> is it possible to open a web site for text input, and read the html code
:> as text into VBA? What would the format for the filename be?
:>
:> Thanks so much in advance!
:>
:> Joey
:>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks