Fix Excel's Invalid Document Error for OneDrive Data Sources
Question details
Resolve an Excel document recognition error when connecting to a data source stored on OneDrive.

- Product
- Microsoft Excel and OneDrive
- Device & OS
- not provided
- Scenario
- A user connects an Excel workbook to an external data source stored on OneDrive, and the connection fails on one computer.
- Observed behavior
- Excel reports that the input could not be recognized as a valid Excel document on the affected computer.
Identify the source file and its OneDrive location, then check whether it opens directly in Excel on the affected computer. Compare the source path and file format with those used on a computer where the connection works.
Check the source workbook format and reconnect
Use this approach if the connector may not recognize the source file's current format or the connection points to the wrong file.
In OneDrive, locate the source workbook and open it in Excel. Confirm that the file opens normally and contains the expected data.
In Excel, select File > Save As and save a copy in the format required by the data connector. If appropriate, try Excel 97-2003 Workbook (.xls); one user reported that converting from .xlsx to .xls resolved the error.
In the destination workbook, select Data > Get Data > From File > From Workbook, choose the saved source file, and follow the prompts to load or transform the data.
Select Data > Refresh All and check whether Excel reads the source without the error.

Check the affected computer's OneDrive connection and updates
Use this approach when the same source works on another computer or converting the workbook does not help.
Open and edit Excel workbooks with WPS Spreadsheets
WPS Office is a free, lightweight alternative for working with spreadsheets in a familiar interface. It supports common Excel formats, making it easy to move existing files into WPS. It does not repair Microsoft Excel's OneDrive connection error.

Frequently Asked Questions
Why does the error appear on only one computer?
The affected computer may use a different source path, OneDrive account, sync state, or software version. Compare the query's Source step and account access with a computer where the connection works.
Will converting XLSX to XLS always fix the error?
No. One user reported success with that conversion, but the result depends on the connector and workbook. Use File > Save As to create an XLS copy only if the data and features fit the older format.
How can I check which file an Excel query uses?
Select Data > Queries & Connections, edit the affected query, and inspect its Source step. Verify that the path points to the intended workbook.
What if the OneDrive source does not open directly in Excel?
Check that you are signed in to the correct OneDrive account and have access to the file. If you use a synced folder, confirm that the file is available locally, then try opening it again.




