Fix Access VBA WinHTTP SharePoint POST Access Denied Error
Question details
Users experience an 'Access Denied' error (0x80070005) when sending SOAP POST requests to SharePoint via Access VBA WinHTTP after Internet Explorer was disabled.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Sending SOAP POST requests to SharePoint using Access VBA WinHTTP, previously relying on Internet Explorer for automatic authentication.
- Observed behavior
- The requests fail with error 2147024891 (0x80070005) 'Access Denied', and supplying WinHttpRequest credentials triggers an unexpected sign-in prompt despite an active Edge session.
Ensure you have administrative privileges to register an application in Microsoft Entra ID (formerly Azure AD) to generate the required OAuth access tokens.
Implement OAuth 2.0 Authentication for SharePoint API
Replace the deprecated Internet Explorer browser session dependency by obtaining and passing an OAuth access token in your REST API requests.
Browsers and REST APIs do not automatically share authentication credentials. Since Internet Explorer is retired and modern browsers like Edge handle sessions differently, WinHttpRequest can no longer piggyback on the browser's active session.
To resolve the Access Denied error (0x80070005), your VBA application must explicitly authenticate using Microsoft Entra ID to obtain an OAuth access token, which is then passed in the request header.
Navigate to the Microsoft Entra admin center, go to App registrations, and register a new application to generate your Client ID and Tenant ID.
Under the API permissions tab, grant the registered application the necessary SharePoint API permissions (e.g., Sites.ReadWrite.All) and click to grant admin consent.
Use a WinHTTP POST request to the Microsoft identity platform token endpoint (https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token), passing your Client ID, Client Secret, and scope to retrieve the JSON access token.
Modify your SharePoint SOAP/REST POST request headers to include the token by adding this code: WinHttpReq.SetRequestHeader "Authorization", "Bearer " & AccessToken.
Experience a Seamless and Modern Office Suite with WPS Office
While specialized database API integrations require Microsoft Access, WPS Office provides a robust, lightweight, and completely free alternative for your daily document, spreadsheet, and presentation needs. Avoid legacy dependencies and enjoy modern compatibility.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install WPS Office: Run the downloaded setup file and follow the on-screen instructions to complete the installation.
- 3. Open Your Files: Launch WPS Office and easily open your existing Microsoft Office files without worrying about formatting issues.

Frequently Asked Questions
Why did my VBA WinHTTP request suddenly stop working?
Your application was likely relying on Internet Explorer's background session for automatic authentication. With Internet Explorer permanently disabled or removed, the API requests can no longer securely fetch these session credentials.
Can I use Microsoft Edge session cookies for VBA API calls?
No, Microsoft Edge isolates its session cookies differently than Internet Explorer. REST APIs and modern browsers do not automatically share credentials, meaning you must implement OAuth token-based authentication.
What is error 0x80070005 in SharePoint REST API?
Error 0x80070005 stands for 'Access Denied'. In the context of API requests, it typically means the request lacks valid authentication tokens or the provided credentials do not have the necessary permissions to perform the requested action.
How do I get an OAuth access token for SharePoint?
You must register your application in Microsoft Entra ID (Azure AD), grant it the appropriate SharePoint API permissions, and then programmatically send a request to the Microsoft Identity Platform endpoint using your Client ID and Client Secret to receive the token.




