Matthew Murdoch Matthew Murdoch - 1 year ago 138
HTTP Question

How can I send an HTTP POST request to a server from Excel using VBA?

What VBA code is required to perform an HTTP POST from an Excel spreadsheet?

Answer Source
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
   URL = ""
   objHTTP.Open "POST", URL, False
   objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
   objHTTP.send ("")

Alternatively, for greater control over the HTTP request you can use "WinHttp.WinHttpRequest.5.1" in place of "MSXML2.ServerXMLHTTP".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download