Xmlhttp request is raising an Access Denied error

后端 未结 9 1766
礼貌的吻别
礼貌的吻别 2020-12-03 21:48

The following Excel macro, which is making an xmlhttp request to this webpage to retrieve some values at a second stage, has worked normally in VBA until some time ago:

相关标签:
9条回答
  • 2020-12-03 21:52

    add "www" after "https://" in your custom Link, Like this:

    XMLPage.Open "GET", "https://www.x-rates.com/table/?from=GBP&amount=3", False    
    XMLPage.send
    
    0 讨论(0)
  • 2020-12-03 21:53

    Update

    Sub WebReq()
    
    link = "http://it.finance.yahoo.com/q?s=^FCHI&ql=10" & Str(Rnd())
    Set htm = CreateObject("htmlFile")
    Dim objHttp
    
        Set objHttp = CreateObject("Msxml2.ServerXMLHTTP")
        objHttp.Open "GET", link, False
    
        objHttp.Send
        htm.body.innerhtml = objHttp.responsetext
        Set objHttp = Nothing
    End Sub
    
    0 讨论(0)
  • 2020-12-03 21:54

    access denied is IE issue

    internet options > security tab > custom security level > Miscellaneous >Access data sources across domains > enable
    
    0 讨论(0)
  • 2020-12-03 21:58

    In my case the user didn't have AD permissions to the proxy server on our corporate network. (Simple oversight when setting up the user.) Adding the missing security group fixed the problem for the user.

    0 讨论(0)
  • 2020-12-03 21:58

    I was able to fix it by changing the link being passed from being "http://" to "https://"

    The site I was pulling had upgraded and trying to pull the data using the unsecured link was failing. Works great now (no code change required.

    0 讨论(0)
  • 2020-12-03 22:01

    i found that, in my case, changing http to https fixed the access denied problem. i can only assume that the website somehow made a change and didn't tell anyone

    0 讨论(0)
提交回复
热议问题