Is there any way to craft an Excel hyperlink formula that would send an HTTP POST on click and parse the response to populate another cell?
Asked
Active
Viewed 2,096 times
3 Answers
0
Public Function HttpPOST(ByVal URL As String) As String
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.send ("")
myText = objHTTP.responseText
getHTTP2 = myText
End Function

Tono Nam
- 34,064
- 78
- 298
- 470
0
[EDIT] Sorry, i didn't see "no vba" in your title. But i can't see how you would do.
You can do it with vba and find valuable information on these threads:
Here is a code sample:
'Send the request
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
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 ("")
'Get the result
myText = objHTTP.responseText
'Set it in the current cell
ActiveCell.Value = myText
Regards,