Use Relative Hyperlinks in Excel Instead of OneDrive URLs
Question details
The user wants Excel hyperlinks to nearby files to use relative paths rather than long OneDrive or SharePoint URLs.

- Product
- Microsoft Excel for Microsoft 365 and OneDrive
- Device & OS
- not provided
- Scenario
- A workbook and its linked files are stored in nearby folders synchronized by OneDrive.
- Observed behavior
- Excel and OneDrive may replace relative file paths with cloud-based SharePoint URLs.
Check that the workbook and target files are available locally in their synchronized folders, and note their folder relationship. Test links in desktop Excel after saving and reopening the workbook, since OneDrive integration may rewrite them.
Create and test a relative file hyperlink in Excel
Use this approach when the workbook and target files keep the same folder structure.
In File Explorer, locate the workbook and target file. For example, if the target is in a Docs folder next to the workbook folder, its relative path may be ..\Docs\file.pdf.
In desktop Excel, select a cell and choose Insert > Link. Enter the relative path in the Address field, set the display text, and select OK.
Save and reopen the workbook, then select the link. Reopen the link editor to check whether Excel retained the relative address or replaced it with a cloud URL.

Check the OneDrive Office sync setting
Try this if Office and OneDrive integration appears to be converting newly created links into cloud URLs.
Use an absolute local path as a workaround
Use a local path when a relative link is rewritten and the file is available in a synchronized folder on the current computer.
Work with Spreadsheet Links in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with spreadsheets. Its Excel format compatibility makes it easier to move existing workbooks into WPS, although it does not change Microsoft OneDrive or Excel sync behavior.

Frequently Asked Questions
Why does Excel change my file link to a SharePoint URL?
Office and OneDrive integration may store or synchronize a hyperlink as a cloud address. Check the address through Excel's Edit Hyperlink option after saving and reopening the workbook.
Where can I turn off Office file sync integration?
Open OneDrive Settings from the cloud icon and look for an Office section. If available and permitted, clear “Use Office applications to sync Office files.” The option may not appear in every version.
Will a local path work for everyone who opens the workbook?
Not necessarily. An absolute path such as C:\Users\username\OneDrive\Docs\file.pdf depends on each user's account and folder location. A relative path may be more portable if the folder structure is the same, but it still needs testing.
Why do I see a warning when opening a local hyperlink?
Excel may display a security warning before opening a linked file. Confirm that the file and its location are trusted before proceeding; local paths do not automatically bypass Trust Center protections.




