SaschaM78
SaschaM78

Reputation: 4497

Excel macro not working because of incorrect proxy settings

Problem description:

My colleague created an Excel-based application some month ago which runs fine on his notebook. Strangely, the same workbook won't work on anyone else's PC. When run inside a virtual Windows 10 session not connected to AD, the workbook also works as expected. We are all using company computers connected to the same AD servers so I can't see why the code works on his machine and not on other machines.

What I found out so far:

PS C:> netsh winhttp show proxy

Current WinHTTP proxy settings:

Direct access (no proxy server).

I assume that there is some setting specifically set up for Excel that I just can't find and I don't have any more ideas where to look.

Code

The Excel macro creates a WinHttpRequest object without changing any additional settings as can be seen in this code excerpt:

Set httpReq = CreateObject("WinHttp.WinHttprequest.5.1")
httpReq.setTimeouts -1, -1, -1, 600000
httpReq.Open "GET", url, False
httpReq.send request
myResponse = httpReq.ResponseText

The url is not pointing to the proxy server but contains a local IP address.

Would appreciate any help on this issue. Thanks in advance!

Upvotes: 1

Views: 1742

Answers (1)

QHarr
QHarr

Reputation: 84465

You can alter proxy settings. For example,

httpReq.SetProxy(1)

This option can be used to specify that all HTTP and HTTPS servers should be accessed directly.

Addit info here though js version

Upvotes: 1

Related Questions