Help creating WinHttp.WinHttpRequest object

I am attempting to create a WinHTTPRequest object in which I have to send some information to the server before I post some xml data to a service that is running on the server.

The code Compiles just fine however when I run it gives the error Cannot Create Automation Object on the following line

Set oWinHttpReq = CreateObject ( “WinHttp.WinHttpRequest”)

Here is the ret of the code …

Public Function InvokeWebService(Byval sURL As String, _

Byval sUserID As String, _

Byval sPassword As String, _

Byval bUsePost As Boolean, _

Byval sPostElements As Variant)

'On Error Resume Next

Const wcMethodName = "InvokeWebService"



Dim oWinHttpReq 



Dim lTimeOut As Long

Dim iCount As Long

Dim iLogonCount As Integer

Dim sResponse As String

Dim m_sResponse

Dim bByteResponse() As Byte

Set oWinHttpReq = CreateObject ( "WinHttp.WinHttpRequest")		

iLogonCount = 0

lTimeOut = wcWebServiceTimeout

retryWebService:

If bUsePost Then

	oWinHttpReq.Open "POST", _

	sURL, False

	oWinHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"

	Call oWinHttpReq.SetCredentials(sUserID, sPassword, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER)

	oWinHttpReq.SetTimeouts lTimeOut, lTimeOut, lTimeOut, lTimeOut

	oWinHttpReq.Send sPostElements

Else

	oWinHttpReq.Open "GET", _

	sURL, False

	Call oWinHttpReq.SetCredentials(sUserID, sPassword, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER)

	oWinHttpReq.SetTimeouts lTimeOut, lTimeOut, lTimeOut, lTimeOut

	oWinHttpReq.Send

End If

Subject: Help creating WinHttp.WinHttpRequest object

Craig,If I might be so bold as to ask you–where did you get these commands?

I searched my Designer 6.5 Help and they were not found!!

Regards

Rolf Pfotenhauer

Subject: Perhaps: Set oWinHttpReq = CreateObject(“WinHttp.WinHttpRequest.5”)