Hi,
I'm trying to execute a URL (includes parameters) from Excel via VBA, without opening a browser. I do not want a response from the website, I simply want to execute the URL.
I've tried using "WinHttp.WinHttpRequest.5.1" to POST the URL, but it keeps failing on the .Send part with "The HTTP redirect request failed".
Here's what I've tried built up from various Google searches on the subject...
Any thoughts on why this would fail at the .Send part? Is there another Object type that would be better suited to just executing a URL with no response required?
Many thanks.
I'm trying to execute a URL (includes parameters) from Excel via VBA, without opening a browser. I do not want a response from the website, I simply want to execute the URL.
I've tried using "WinHttp.WinHttpRequest.5.1" to POST the URL, but it keeps failing on the .Send part with "The HTTP redirect request failed".
Here's what I've tried built up from various Google searches on the subject...
Code:
Set httpSend = CreateObject("WinHttp.WinHttpRequest.5.1")
websiteURL = "https://www.somewebsite.com/?&staticVariable=xxxx"
websiteArguments = "&anotherVariable=" & variable2
httpSend.Open "POST", websiteURL, False
httpSend.Send (websiteArguments)
websiteResponse = httpSend.ResponseText
Set httpSend = Nothing
Any thoughts on why this would fail at the .Send part? Is there another Object type that would be better suited to just executing a URL with no response required?
Many thanks.