logo
search
Power Query Problems

How to Fix Power Query Errors with OneDrive Personal Excel Links

Camila MilosovichCamila Milosovich Sep 27, 2026 868 views

Question details

The user needs to resolve an HTML data type error that occurs in Power Query when attempting to import data from an Excel file hosted on OneDrive Personal.

How to Fix Power Query Errors with OneDrive Personal Excel Links
Product
Microsoft Excel
Device & OS
not provided
Scenario
Importing Excel data from a OneDrive Personal share link using the Web.Contents function in Power Query.
Observed behavior
Power Query returns an HTML data type error because the OneDrive download URL redirects to a web page (such as a file viewer or sign-in page) instead of returning the raw Excel file.
Before you start

Make sure you have the exact sharing link from your OneDrive Personal account and verify that the file is not restricted by specific sign-in permissions that block automated web queries.

Solution 1Recommended

Modify the OneDrive Link for Direct Download

Power Query requires a direct file link to read the data correctly. You must manually alter the standard OneDrive Personal sharing URL to bypass the web viewer and force a file download.

By default, OneDrive Personal sharing links are designed for browsers and load an HTML-based Excel viewer. Power Query cannot parse this HTML interface, which is why the data type error occurs.

1
Generate the Sharing Link

Navigate to your file in OneDrive Personal, right-click the Excel file, select 'Share', and copy the standard sharing link.

2
Modify the URL Parameters

Paste the link into a text editor. Look at the end of the URL; if it ends with '?web=1' or similar parameters, change it to '?download=1'. In some link structures, you may need to replace the word 'embed' with 'download' in the URL path.

3
Update the Power Query Connection

Open Excel, go to the 'Data' tab, click 'Get Data' > 'Data Source Settings'. Locate your previous OneDrive connection, click 'Change Source', and paste the newly modified direct-download URL.

Modify the OneDrive Link for Direct Download
Test the URL in a Browser: Before pasting the modified URL into Power Query, paste it into an incognito browser window. If it immediately downloads the Excel file rather than opening a webpage, the link is formatted correctly.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Management

If you are frustrated by complex Power Query errors, authentication issues, and broken OneDrive links in Microsoft Excel, WPS Office offers a highly compatible, free, and lightweight alternative. Enjoy a familiar interface and robust spreadsheet tools without the complex cloud setup.

  1. 1. Download and Install: Visit the official WPS Office website and download the free version for your operating system.
  2. 2. Open Your Excel File: Launch WPS Spreadsheets and open your existing .xlsx files directly, preserving all your data and formatting.
  3. 3. Work Without Hassle: Use WPS Office's built-in data tools to filter, analyze, and manage your data without worrying about complex web query errors.
Fully compatible with Microsoft Excel (.xlsx, .xls) and CSV formatsLightweight installation with extremely fast loading timesFree built-in cloud storage for easy file sharing and syncingFamiliar tabbed interface that requires zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query return an HTML error for my Excel file?

This happens when the provided OneDrive link redirects Power Query to a web-based file viewer or a login page instead of the direct raw file. Power Query attempts to read the webpage's HTML code instead of the actual spreadsheet data.

Can I use OneDrive Business links the same way as OneDrive Personal?

No, OneDrive for Business uses SharePoint's backend and requires 'Organizational account' authentication in Power Query. Personal links generally require modifying the URL for direct download and using 'Anonymous' access.

How do I safely share my Power Query issue online?

Always remove sensitive data, private access keys, and personal authentication tokens from your Web.Contents URL and M code before posting in public forums or communities.