Forum Discussion
joanmartinez
Aug 20, 2024Copper Contributor
VBA XMLHTTP Post Error 2147024891 (0x80070005) acces denied
I'm using a Microsoft Access application where I'm doing some POST Rest api to sharepoint
httpObject As New XMLHTTP
httpRequest = "<?xml version='1.0' encoding='utf-8'?>" & _ "<soap:Envelope xmlnsxsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" & _ "<soap:Body>" & _ "<GetCurrentUserInfo xmlns='http://schemas.microsoft.com/sharepoint/soap/directory/' />" & _ "</soap:Body>" & _ "</soap:Envelope>"
soapAction = "http://schemas.microsoft.com/sharepoint/soap/directory/GetCurrentUserInfo"
httpObject.Open "POST", servei_URL, False
httpObject.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
httpObject.setRequestHeader "SOAPAction", soapAction
httpObject.setRequestHeader "Connection", "Keep-Alive"
httpObject.Send httpRequest
This post method has an error result, because acces is denied.
Before Internet Explorer was deactivated, this works perfectly, the application had the credentials and get some response. (Before, an Internet Explorer window was opened to log in Sharepoint. Now in these window appears a message like Internet Explorer is no longer available for Sharepoint)
Now, I can't send the credentials into post method
I tried to use WinHttpRequest and set the credentials into:
Objecte_HTTP.setCredentials "domain\user", "password", 0
But I get a response within "Sign in to your account"
PD: I have an active session logged in to Egde
No RepliesBe the first to reply