XMLHTTP

T

Tom

Hello,

I'm a newbie and have no experience with XMLHTTP. I found the following
script on the net which works fine:

Sub GetHTTPData()
Dim sURL As String, sHTML As String
Dim oHttp As Object

sURL = "http://www.blabla.com"

On Error Resume Next
Set oHttp = CreateObject("MSXML2.XMLHTTP")
If Err.Number <> 0 Then
Set oHttp = CreateObject("MSXML.XMLHTTPRequest")
MsgBox "Error 0 has occured while creating a MSXML.XMLHTTPRequest
object"
End If
On Error GoTo 0
If oHttp Is Nothing Then
MsgBox "For some reason I wasn't able to make a MSXML2.XMLHTTP object"
Exit Sub
End If

'Open the URL in browser object
oHttp.Open "GET", sURL, False
oHttp.Send
sHTML = oHttp.responseText
End Sub

But what I really want is to logon to a secure server. Does anybody know how
I need to enter the logon information? An example would be appreciated.

Regards,
Tom
 
J

JP

You'll have to browse for it. In the VBA IDE, Go to Tools >
References, click Browse and go to your local system32 folder.

Or you could declare the reference As Object and use CreateObject
("InternetExplorer.Application") instead.

--JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top