Fix Excel CELL Function Returning OneDrive URL Instead of File Path
Question details
The user needs a valid local Windows folder path from the Excel CELL function for Power Query, but the workbook stored in OneDrive returns a URL-style location instead.

- Product
- Microsoft Excel and OneDrive
- Device & OS
- Windows
- Scenario
- The user stores an Excel workbook in OneDrive and uses the CELL function to provide a file or folder path to Power Query.
- Observed behavior
- Excel CELL returns an https:// OneDrive URL instead of a local Windows path, and Power Query rejects the value because it is not a valid absolute folder path.
Confirm whether the OneDrive files are synced locally on the Windows PC, and open the workbook from File Explorer rather than from the OneDrive web portal before checking the CELL function result.
Use the synchronized OneDrive local folder path for Power Query
Use this solution when the workbook is already synced to a local Windows OneDrive folder and you need a local absolute path instead of the OneDrive web URL.
Power Query expects a valid local folder path, such as C:\Users\Name\OneDrive\Folder. When the same workbook is opened from File Explorer rather than from the OneDrive web view, Excel can return the local path that Power Query accepts.
Select the OneDrive cloud icon in the Windows notification area, open OneDrive settings, and confirm that the file or folder is set to "Always keep on this device" or is already synced locally.
Open File Explorer, go to the local OneDrive folder such as C:\Users\Name\OneDrive, and double-click the workbook there instead of opening it from the OneDrive web portal.
Select the cell containing =CELL("filename") and confirm that it now returns a local path beginning with C:\. If it still returns https://, close and reopen the workbook from File Explorer.
Copy the folder portion of the returned local path and paste it into your Power Query parameter or folder query, then refresh the query.

Move or copy the workbook to a non-OneDrive local folder
Use this solution if the workbook cannot stay available locally through OneDrive or you need a stable path outside OneDrive for Power Query.
Use WPS Office as a free alternative for local Excel-compatible workbook work
When Excel and OneDrive path behavior disrupts Power Query workflows, WPS Office provides a free, lightweight alternative for opening, editing and saving .xlsx workbooks locally, with a familiar ribbon UI and smooth migration from Microsoft Office.
- 1. Download WPS Office Free: Go to the official WPS Office download page and install WPS Office on your Windows PC.
- 2. Open the workbook locally: Launch WPS Office Spreadsheets and open the .xlsx workbook from a local Windows folder.
- 3. Use local file paths for data work: When connecting to files or folders, use the local Windows path shown in the WPS Office file location rather than a OneDrive URL.

Frequently Asked Questions
Why does Excel return a OneDrive URL from CELL("filename")?
When a workbook is opened from OneDrive or SharePoint, Excel may return the cloud URL instead of a local Windows path. Power Query requires a valid local absolute path, so the URL is often rejected.
How do I get a local file path from a OneDrive-synced workbook?
Open the workbook from File Explorer in the local OneDrive folder, not from the web portal. If the file is synced locally, =CELL("filename") should return a path such as C:\Users\Name\OneDrive\... instead of https://.
Can WPS Office change how Excel CELL returns OneDrive URLs?
No. This behavior originates in Microsoft Excel and OneDrive. WPS Office does not alter Excel's OneDrive URL behavior, but it can open and save .xlsx workbooks locally as a free alternative for compatible spreadsheet work.
Does WPS Office include Excel Power Query?
WPS Office includes spreadsheet data features, but Excel Power Query is a Microsoft Excel feature. For exact Power Query workflows, use Excel with a local file path or a local copy of the workbook.
What should I do if my OneDrive folder is not synced locally?
In OneDrive settings, enable Files On-Demand or choose "Always keep on this device" for the folder, wait for the files to sync, then open the workbook from the local OneDrive folder so a local path is returned.




