Power Query Problems

Fix Power Query Cannot Connect to Excel File in OneDrive

John WilsonJohn Wilson Oct 28, 2026 868 views

Question details

The user is unable to connect to an Excel file hosted on a school OneDrive using Power Query due to web authentication failures.

How to Fix Power Query Cannot Connect to an Excel File in OneDrive
Product
Microsoft Excel
Device & OS
not provided
Scenario
Attempting to retrieve data from an online OneDrive Excel file via Power Query or VBA.
Observed behavior
The data connection works locally but fails during the web authentication step when connecting to the school OneDrive data source.
Before you start

Before troubleshooting, ensure you are signed into Excel with your school or organizational account and have the exact URL of your OneDrive file.

Solution 1Recommended

Configure Organizational Credentials in Data Source Settings

Clear any incorrect cached credentials and explicitly sign in using your organizational account to authenticate with the school OneDrive.

Power Query often caches login attempts. If you previously tried connecting using 'Anonymous' or 'Windows' credentials, the connection will fail for a school OneDrive account.

1
Open Data Source Settings

Open Excel, navigate to the 'Data' tab on the ribbon, click on 'Get Data', and select 'Data Source Settings'.

2
Clear Existing Permissions

Select 'Global permissions' at the top, locate the URL corresponding to your school OneDrive or SharePoint, and click 'Clear Permissions'.

3
Reconnect with Organizational Account

Attempt to connect to your web data source again. When the credentials prompt appears, select 'Organizational account' from the left sidebar and click 'Sign In'.

Configure Organizational Credentials in Data Source Settings
Authentication Tip: Using the 'Organizational account' option ensures Excel communicates properly with your school's Microsoft 365 directory rather than using generic web credentials.
Free Microsoft Office alternative

Experience Hassle-Free Data Management with WPS Office

If complex Power Query connections and Microsoft Excel authentication errors are slowing you down, consider switching to WPS Office. It provides a lightweight, highly compatible alternative for handling spreadsheets and data analysis without the steep learning curve or complicated credential setups.

  1. 1. Download WPS Office: Visit the official WPS website and download the free office suite.
  2. 2. Install and Launch: Follow the straightforward installation wizard and open WPS Spreadsheets.
  3. 3. Open Your Data Files: Easily import your existing Excel files and continue your data tasks without complex configurations.
Highly compatible with Microsoft Excel formats including .xlsx, .xls, and .csv.Free, lightweight, and fast spreadsheet processing that doesn't drag your system down.Familiar interface ensures seamless migration from Microsoft Office.Built-in cloud integration for easy and secure file sharing.
QA img-9

Frequently Asked Questions

Why does Power Query show an authentication error when connecting to my school OneDrive?

This typically occurs if Power Query is attempting to use 'Anonymous' or 'Windows' credentials by default instead of an 'Organizational account'. You must clear your data source permissions and re-authenticate using your designated school email.

How do I clear my cached credentials in Power Query?

Go to the 'Data' tab on the Excel ribbon, select 'Get Data', and click 'Data Source Settings'. Choose 'Global permissions', select the OneDrive URL causing the issue, and click 'Clear Permissions'.

Can I connect Power Query to a personal OneDrive account?

Yes, but the process differs from school or enterprise accounts. You typically need to generate an embed link from the personal OneDrive file and use the 'Web' connection option in Power Query, ensuring you remove the '?web=1' tag from the URL.

Why does my VBA macro work for local files but fail for OneDrive web files?

VBA macros using standard local file paths (like C:\Users\...) only work for locally synced files. To connect to a file hosted on OneDrive via the web, the VBA code must be explicitly updated to use the HTTPS SharePoint or OneDrive URL.