Which references to add in HTTP Request from Excel VBA

Usefull to test it:

Sub Testa()
 Dim aTests: aTests = Array( _
        "Microsoft.XMLHTTP" _
      , "Msxml2.XMLHTTP" _
      , "Msxml2.XMLHTTP.3.0" _
      , "Msxml2.XMLHTTP.4.0" _
      , "Msxml2.XMLHTTP.5.0" _
      , "Msxml2.XMLHTTP.6.0" _
      , "Microsoft.XMLHTTP.6.0" _
      , "Msxml2.XMLHTTP.7.0" _
 )
 Dim sProgId, sTypeName
 For Each sProgId In aTests
     Dim oX
   On Error Resume Next
     Set oX = CreateObject(sProgId)
     If 0 = Err.Number Then
        sTypeName = TypeName(oX)
     Else
        sTypeName = Err.Description
     End If
   On Error GoTo 0
     MsgBox sProgId + "=>" + sTypeName
 Next
End Sub

You must reference Microsoft XML, v 3.0.

See: https://msdn.microsoft.com/en-us/library/ms763701%28v=vs.85%29.aspx

With Microsoft XML, v 6.0 the type must be MSXML2.ServerXMLHTTP60.

Tags:

Excel

Vba