title: cURL via VBA (Maxmind)
body: <p>I'm trying to run the following cURL request (as provided by Maxmind) within VBA:</p>
  
  <pre><code>curl -u "{user_id}:{license_key}" \
      "https://geoip.maxmind.com/geoip/v2.1/city/me?pretty"
  </code></pre>
  
  <p>Taking from other examples I've tried the following:</p>
  
  <pre><code>Sub maxmind_query()
  
  Dim TargetURL As String
  Dim HTTPReq As Object
  
  TargetURL = "https://geoip.maxmind.com/geoip/v2.1/city/me"
  Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1")
  HTTPReq.Option(4) = 13056 '
  HTTPReq.Open "PUT", TargetURL, False
  HTTPReq.SetCredentials "XXXXX", "YYYYYYYY", 0
  HTTPReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  HTTPReq.send ("test[status]=" &amp; Forms!curl!Text0.Value &amp; "&amp;test2[status]=" &amp; Text2.Value)
  MsgBox (HTTPReq.responseText)
  
  End Sub
  
  '''XXXX is my user id, YYYY my license key, removed for obvious reasons!
  </code></pre>
  
  <p>This errors at HTTPReq.send  (runtime error 424 object required) which has me stumped. </p>
  
  <p>I have no knowledge of cURL so despite a few days of research and blind attempts, I'm struggling to get anywhere with the above code.  </p>
  
  <p>I'm only experienced with VBA, and what I know is self taught, so be gentle....</p>
  
  <p>If anyone is able to share their knowledge I'd be much obliged.</p>
  
  <p>Further info provided by Maxmind:</p>
  
  <p><a href="http://dev.maxmind.com/geoip/geoip2/web-services/#Per-Service_URIs" rel="nofollow">http://dev.maxmind.com/geoip/geoip2/web-services/#Per-Service_URIs</a>
  <a href="http://dev.maxmind.com/geoip/geoip2/web-services/#Command_Line_curl_Example" rel="nofollow">http://dev.maxmind.com/geoip/geoip2/web-services/#Command_Line_curl_Example</a></p>
  
  <p>Many thanks!</p>
  
  <p>PS.  If I put the URL in a browser, input username and password into message box, the browser returns the required information, so I know the service and my credentials work. I guess my code isn't even getting that far though.</p>