ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   XMLHTTP (https://www.excelbanter.com/excel-programming/435045-xmlhttp.html)

Tom

XMLHTTP
 
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





JP[_4_]

XMLHTTP
 
I use XMLHTTP as a one-way method to get information from the web. You
might need to automate Internet Explorer instead.

See http://www.codeforexcelandoutlook.co...rnet-explorer/
for sample code.

--JP

On Oct 16, 11:15*am, "Tom" wrote:
Hello,

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

-- snip --

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


Tom

XMLHTTP
 
Hello JP,

Thank you for the answer. I followed your link and tried to work with the
shown example but I'm not able to create a reference to the "Microsoft
Internet Controls (shdocvw.dll)" library.

Tom




"JP" schrieb im Newsbeitrag
...
I use XMLHTTP as a one-way method to get information from the web. You
might need to automate Internet Explorer instead.

See
http://www.codeforexcelandoutlook.co...rnet-explorer/
for sample code.

--JP

On Oct 16, 11:15 am, "Tom" wrote:
Hello,

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

-- snip --

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



JP[_4_]

XMLHTTP
 
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

On Oct 16, 12:43*pm, "Tom" wrote:
Hello JP,

Thank you for the answer. I followed your link and tried to work with the
shown example but I'm not able to create a reference to the "Microsoft
Internet Controls (shdocvw.dll)" library.

Tom


Tim Williams[_2_]

XMLHTTP
 

http://msdn.microsoft.com/en-us/libr...49(VS.85).aspx

Try the username/passowrd parameters in the Open method.

Tim

"Tom" wrote in message
...
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








All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com