cmccurdy
asked on
Error 429 - "ActiveX component can't create object in Access
I'm trying to post to an API but the routine fails with Run-time error 429 - "ActiveX component can't create object" on the line -> Set objHTTP = CreateObject("MSXML6.Serve rXMLHTTP")
The code which fails is"
Private Sub cmdCreateAutoTextCustomer_ Click()
Dim objHTTP As Object
Dim Json As String
Dim URL As String
Json = "{""shop_number"": ""8729925026"",""client_co de"": ""142KukK231k."",""lastnam e"": ""Ender"",""phonenumber"": ""5555555559"",""vehicle_y ear"": ""2009"",""vehicle_make"": ""JEEP"",""vehicle_model"" : ""something"" }"
Dim result As String
Set objHTTP = CreateObject("MSXML6.Serve rXMLHTTP")
URL = "http://somewebsite.me/api/v1/customers"
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "Content-type", "application/json"
objHTTP.setRequestHeader "Accept", "application / json"
objHTTP.send (Json)
result = objHTTP.responseText
'Some simple debugging
Range("A25").Value = result
Range("A26").Value = Json
Set objHTTP = Nothing
End Sub
The code which fails is"
Private Sub cmdCreateAutoTextCustomer_
Dim objHTTP As Object
Dim Json As String
Dim URL As String
Json = "{""shop_number"": ""8729925026"",""client_co
Dim result As String
Set objHTTP = CreateObject("MSXML6.Serve
URL = "http://somewebsite.me/api/v1/customers"
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "Content-type", "application/json"
objHTTP.setRequestHeader "Accept", "application / json"
objHTTP.send (Json)
result = objHTTP.responseText
'Some simple debugging
Range("A25").Value = result
Range("A26").Value = Json
Set objHTTP = Nothing
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Can you try CreateObject("msxml2.Serve rXMLHTTP.6 .0")
I haven't tested....
This is the progid I found in my registry for msxml6.dll
Thank,
Darren
Can you try CreateObject("msxml2.Serve
I haven't tested....
This is the progid I found in my registry for msxml6.dll
Thank,
Darren
ASKER
Thanks Darren,
CreateObject("msxml2.Serve rXMLHTTP.6 .0") worked.
Now my problem is I'm not getting back the response correctly although the record seems to have been created properly.
Can you help on that also? What I'm trying to do is found here. (https://www.experts-exchange.com/questions/29116183/JSON-post-with-Access-VBA.html)
CreateObject("msxml2.Serve
Now my problem is I'm not getting back the response correctly although the record seems to have been created properly.
Can you help on that also? What I'm trying to do is found here. (https://www.experts-exchange.com/questions/29116183/JSON-post-with-Access-VBA.html)
ASKER