logo
search
OneDrive File Issues

How to Get an Excel File's Local Path Instead of a OneDrive URL

WPS EditorWPS Editor Oct 12, 2026 869 views

Question details

The user wants to retrieve the local Windows path of an Excel file rather than its OneDrive HTTPS URL when using functions or scripts.

How to Get an Excel File's Local Path Instead of a OneDrive URL
Product
Microsoft Excel
Device & OS
not provided
Scenario
Using the CELL("filename") function or VBA in a workbook that is synchronized with OneDrive.
Observed behavior
Excel returns the cloud-based HTTPS OneDrive path instead of the expected local drive path (e.g., C:\Users\...).
Before you start

Ensure your file is fully downloaded to your local drive and temporarily disable AutoSave to test if it forces Excel to recognize the local directory.

Solution 1Recommended

Adjust AutoSave and Excel Account Settings

Disabling AutoSave and verifying your Office account connections can stop Excel from defaulting to the cloud version of the file.

When an Excel workbook is opened from a cloud-synchronized location, Excel often defaults to the cloud environment. This causes functions like CELL("filename") to return the OneDrive web URL. Disabling AutoSave and checking account configurations can force Excel to use the local path.

1
Open from File Explorer

Close the workbook and reopen it directly from your local File Explorer rather than using Excel's 'Recent' files list.

2
Disable AutoSave

Toggle off the 'AutoSave' switch located in the top-left corner of the Excel window.

3
Verify Account Settings

Navigate to 'File' > 'Account' and compare the connected services with your OneDrive application settings to ensure they match.

4
Recalculate the Formula

Go back to your worksheet, select the cell with the formula =CELL("filename", A2), and press 'F9' to recalculate. Check if it now displays the local path.

Adjust AutoSave and Excel Account Settings
Account Consistency: If you are collaborating, ensure that your OneDrive configuration and Office account settings match those of colleagues who are seeing the correct local path.
Free Microsoft Office alternative

Avoid Complex Sync Issues with WPS Office

If you are tired of wrestling with OneDrive URL formatting errors in Excel, consider switching to WPS Office. It provides a stable, locally-focused workspace while seamlessly integrating with your cloud files when needed.

  1. 1. Download the Software: Visit the official WPS Office website and download the free installation package.
  2. 2. Install and Launch: Run the installer, open WPS Spreadsheets, and customize your workspace.
  3. 3. Open Your Spreadsheets: Open your existing .xlsx files directly. WPS Office will perfectly execute your formulas with precise local path recognition.
Fully compatible with Microsoft Excel (.xlsx) formulas and formatsReliably processes local file paths without forcing cloud URLsLightweight, fast, and free to useFamiliar user interface requires no learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why does CELL("filename") show an HTTPS link instead of my C: drive?

When a file is synced with OneDrive and AutoSave is active, Microsoft Excel treats the file as a cloud document. Consequently, it returns the file's web URL instead of the local cache path on your computer.

Can I permanently force Excel to use local paths for synced folders?

You can mitigate this by pausing OneDrive sync, or by unchecking the setting 'Use Office applications to sync Office files that I open' within the OneDrive app's settings. However, this may affect your real-time collaboration features.

Does this issue also affect VBA scripts using ThisWorkbook.Path?

Yes. If the workbook is recognized as a cloud file via OneDrive integration, ThisWorkbook.Path in VBA will also return an HTTPS URL instead of the local directory path.