troubleshooting Question

Error 429 - "ActiveX component can't create object in Access

Avatar of cmccurdy
cmccurdyFlag for United States of America asked on
VBA* WinHTTP
4 Comments1 Solution143 ViewsLast Modified:
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.ServerXMLHTTP")

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_code"": ""142KukK231k."",""lastname"": ""Ender"",""phonenumber"": ""5555555559"",""vehicle_year"": ""2009"",""vehicle_make"": ""JEEP"",""vehicle_model"": ""something"" }"

    Dim result As String

    Set objHTTP = CreateObject("MSXML6.ServerXMLHTTP")
    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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros