在不打开浏览器的情况下从Excel(VBA)打开URL

我们有一个系统,可以创buildlogging,只需通过一个适当的参数运行的URL。 我想通过在后台执行我构build的URL(无浏览器)使用VBA将其构build到Excel中。

我发现引用Stackoverflow使用WinHttp.WinHttpRequest.5.1 .post ,但在我发现的人使用这个他们正在寻找从网站得到响应的所有事件。

我已经试过这个,但它没有工作(variables已经被声明)。

 Set httpSend = CreateObject("WinHttp.WinHttpRequest.5.1") websiteURL = "https://www.somewebsite.com/?&staticVariable=xxxx" & URLEncode(variable1) websiteArguments = "&anotherVariable=" & URLEncode(variable2) httpSend.Open "POST", websiteURL, False httpSend.Send (websiteArguments) websiteResponse = httpSend.ResponseText Set httpSend = Nothing 

为了logging,当我运行上面的代码时,我在httpSend.Send (websiteArguments)阶段得到了有关“ HTTPredirect请求失败 ”的运行时错误。

用WinHttp.WinHttpRequest.5.1发布最佳的方式来实现我正在寻找的结果。 有没有另一个更有效的方式来运行一个url,而无需打开浏览器? 再次重申,我不是在寻找来自网站的回应,我只是想执行该url。

非常感谢。