logo
search
OneDrive File Issues

How to Fix Excel Using SharePoint URLs Instead of Local File Paths

Camila MilosovichCamila Milosovich Oct 10, 2026 869 views

Question details

Excel files, macros, reports, and Power Query connections are unexpectedly utilizing SharePoint or OneDrive HTTPS URLs instead of local absolute paths.

How to Fix Excel Using SharePoint URLs Instead of Local File Paths
Product
Microsoft Excel, OneDrive
Device & OS
not provided
Scenario
Running local macros, generating reports, or refreshing Power Query connections on files synchronized via OneDrive or SharePoint.
Observed behavior
Office returns an HTTPS cloud location URL instead of the physical local path (e.g., C:\), causing scripts and data connections to fail or behave incorrectly.
Before you start

Verify your current OneDrive client synchronization status and ensure your target files are fully downloaded to your local drive.

Solution 1Recommended

Use VBA or Power Query to Map Cloud URLs to Local Paths

Since modern versions of Office enforce cloud paths for synced files, you can programmatically replace the SharePoint URL with your local environment path.

Files stored in SharePoint or OneDrive naturally retain an HTTPS cloud location, even when fully synchronized to a local folder. Because recent versions of OneDrive have removed the option to disable Office file collaboration, the most reliable workaround is to dynamically replace the cloud path string with a local physical path using scripts or queries.

1
Identify the environment path

In VBA or Power Query, retrieve the user's local profile path (e.g., using the Environ("USERPROFILE") function in VBA).

2
Extract the relative file path

Parse the returned HTTPS SharePoint URL to remove the domain and SharePoint site prefix, leaving only the folder structure.

3
Concatenate the local path

Combine the local environment profile path with the relative folder structure to create a valid C:\ absolute path for your macros or connections to use.

Use VBA or Power Query to Map Cloud URLs to Local Paths
Free Microsoft Office alternative

Avoid Cloud Path Conflicts with WPS Office

If Microsoft Excel's forced SharePoint URLs are disrupting your workflow and breaking your local file references, consider switching to WPS Office. WPS Office respects traditional local file paths, ensuring your offline files, macros, and connections work exactly as intended without forced cloud URL replacements.

  1. 1. Download and Install: Download WPS Office for free from the official website and complete the quick installation process.
  2. 2. Open Your Spreadsheets: Launch WPS Spreadsheets and open your local .xlsx or .xls files directly from your hard drive.
  3. 3. Work with Local Paths: Enjoy standard local file paths (e.g., C:\) for all your references, scripts, and data tasks without cloud URL interference.
Strictly respects local physical paths for offline filesFully compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Lightweight, fast installation with a familiar user interfaceRobust offline performance without forced cloud synchronizations
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel change my local file path to an HTTPS SharePoint URL?

When a file is stored in a folder synced by OneDrive or SharePoint, Microsoft Office treats it as a cloud document by default to enable features like AutoSave and real-time co-authoring. Consequently, properties like FullName return the cloud URL rather than the local physical path.

Is the 'File Collaboration' option still available in OneDrive?

No, Microsoft has removed the 'Use Office applications to sync Office files that I open' option in recent updates to the OneDrive client. You can no longer toggle this setting to force local paths via the OneDrive UI.

How can I fix broken Power Query links caused by OneDrive URLs?

You can resolve this by editing your Power Query M code to dynamically replace the SharePoint URL prefix with your local root directory (using a parameter), ensuring the query constructs a valid local absolute path during data refresh.