How to Get a Usable OneDrive Download Link for Power Query
Question details
The user needs to retrieve a direct, functional OneDrive download link to import data correctly using Power Query's 'From Web' feature.

- Product
- Excel / Power Query
- Device & OS
- not provided
- Scenario
- Using the 'From Web' data source feature in Power Query to connect to a file hosted on OneDrive.
- Observed behavior
- Power Query imports the HTML code of the OneDrive web viewer instead of the actual data from the file when using a shortened 1drv.ms link.
Ensure you have the original shortened OneDrive sharing link (1drv.ms) and that the file permissions allow for viewing or downloading.
Convert Shortened Link to Direct Download URL via Browser
Use this method to manually resolve the redirect and modify the URL parameters so Power Query bypasses the web viewer.
By default, shortened OneDrive links redirect to a web viewer. You must obtain the full URL and change the view parameter to force a file download.
Paste your shortened 1drv.ms OneDrive sharing link into your web browser's address bar and press Enter to load the page.
Wait for the web page to load completely. Copy the new, longer URL that appears in the address bar, which should start with onedrive.live.com.
Paste the copied URL into a text editor. Look for the word 'embed' in the URL and replace it with 'download'.
Open Excel Power Query, select 'From Web', and paste your modified download URL to successfully import the file data.

Use the Email Sharing Workaround to Get an Older Link Format
If browser redirection doesn't give you the correct format, you can use OneDrive's email sharing feature to generate a direct link.
Simplify Your Document Workflows with WPS Office
If you are tired of dealing with complex link conversions and troubleshooting Microsoft ecosystem quirks, consider switching to WPS Office. It provides a lightweight, user-friendly environment for managing all your spreadsheets and documents.
- 1. Download and Install: Visit the official WPS website and download the free WPS Office suite for your device.
- 2. Open Your Data: Launch WPS Spreadsheets and easily open your existing Excel workbooks without format loss.
- 3. Manage Data Easily: Use WPS Cloud for seamless, hassle-free file synchronization without needing to manage complex link parameters.

Frequently Asked Questions
Why does Power Query show an HTML table instead of my data?
When using a shortened OneDrive link (1drv.ms), Power Query connects to the OneDrive web viewer page rather than the file itself. This results in the extraction of the page's HTML elements instead of your spreadsheet data.
Do I need a specific OneDrive subscription for this to work?
No, this URL modification trick works for standard personal OneDrive accounts (onedrive.live.com). For OneDrive for Business or SharePoint, the link structure and authentication methods differ, requiring you to use the file's direct path without the '?web=1' parameter.
How do I refresh the data once connected?
Once you have successfully connected using the modified 'download' URL, you can click 'Refresh All' in the Data tab at any time to pull the latest updates directly from the hosted OneDrive file.




