logo
search
Power Query Problems

Fix Excel Power Query Connection Errors for OneDrive Files

Natalie TaylorNatalie Taylor Oct 12, 2026 870 views

Question details

The user needs to fix an issue where Power Query fails to connect to a macro-enabled Excel workbook (.xlsm) stored in OneDrive.

Fix Excel Power Query Connection Errors for OneDrive Files
Product
Microsoft Excel
Device & OS
not provided
Scenario
Attempting to import data into Power Query from an .xlsm file hosted on OneDrive by copying the file path from the Excel File > Info menu.
Observed behavior
Power Query throws an error stating that the file is not recognized as an Excel workbook because the copied path points to an HTML web page rather than the actual file.
Before you start

Ensure you have the correct permissions to access the target file on OneDrive, and verify whether you have the OneDrive desktop sync client installed on your computer.

Solution 1Recommended

Use the Direct Local File Path

Replace the web-based URL with the local synchronization path provided by the OneDrive desktop client.

When you copy a link directly from Excel's Info panel, it often includes web parameters (like '?web=1') that turn the path into an HTML page link. Power Query cannot parse HTML as a workbook. Using the local sync path bypasses this issue.

1
Locate the OneDrive Folder

Open Windows File Explorer and navigate to your local OneDrive synchronization folder where the target .xlsm file is stored.

2
Copy the Local Path

Hold down the Shift key, right-click the target .xlsm file, and select 'Copy as path' from the context menu.

3
Update Power Query Source

Open your destination Excel workbook, navigate to the Data tab, and launch the Power Query Editor. Go to the Source step in your query settings and replace the old web URL with the newly copied local file path.

Use the Direct Local File Path
Tip: Remove the quotation marks at the beginning and end of the copied path before pasting it into the Power Query formula bar.
Free Microsoft Office alternative

Switch to WPS Office for a Seamless Spreadsheet Experience

If you frequently encounter complex connection errors and heavy processing issues in Microsoft Excel, consider WPS Office. It provides a lightweight, highly compatible alternative for viewing, editing, and managing your spreadsheets without the heavy software overhead.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package.
  2. 2. Install the Software: Run the installer to quickly set up WPS Office on your computer.
  3. 3. Open Your Workbooks: Launch WPS Spreadsheets and directly open your existing Excel files seamlessly.
Fully compatible with Microsoft Excel formats, including .xlsx, .xlsm, and .csv.Lightweight spreadsheet processor for smooth and fast data management.Familiar user interface requiring zero learning curve.Built-in cloud sync for easy file management across devices.
QA img-9

Frequently Asked Questions

Why does Excel say my OneDrive file is not recognized as a workbook?

When copying a path from File > Info in Excel, it often includes a web suffix like '?web=1', making it an HTML web address. Power Query expects a direct file path or a raw file stream, so it fails to parse the HTML page as an Excel workbook.

Do I need the OneDrive desktop app installed to use Power Query with cloud files?

No, you do not strictly need it. You can connect to cloud files without the desktop app by using the 'From Web' connector in Power Query and pasting the file's SharePoint or OneDrive for Business URL (making sure to remove any web query parameters at the end of the link).

Where should I post advanced Power Query questions for troubleshooting?

Advanced Power Query and M-code questions are best posted in Microsoft Q&A forums or the dedicated Power Query forum within the Power Platform Community, where product experts and developers can provide specialized support.