What VBA code is required to peform an HTTP POST from an Excel spreadsheet?
Accepted Answer Note: For greater control over the HTTP request you can use "WinHttp.WinHttpRequest.5.1" in place of "MSXML2.ServerXMLHTTP"
What VBA code is required to peform an HTTP POST from an Excel spreadsheet?
Accepted Answer Note: For greater control over the HTTP request you can use "WinHttp.WinHttpRequest.5.1" in place of "MSXML2.ServerXMLHTTP"
I believe the ServerXMLHTTP object can used to do it.
Let me see if I can find a code sample.
Bill the Lizard nailed it :)
I did this before using the MSXML library and then using the XMLHttpRequest object. See http://scriptorium.serve-it.nl/view.php?sid=40
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
URL = "http://www.somedomain.com"
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send ("")
I hope it's ok to ask a closely related question here, since I couldn't find anything in the site FAQs suggesting otherwise.
Can this be adapted so that the POST request is made and the resulting response is shown in the user's default web browser rather than returned behind the scenes to Excel (or in my case Access)? I want the user to fill out a form in Access and click a submit button, then arrive at the resulting webpage just as if the form had been a webpage in the first place.
So, technically speaking, I want VBA to create a POST request but have it actually executed by the user's web browser. This question is the closest I've come googling since all the search terms involved have such broad meanings. Is this even close?