Fix Excel's "Cannot open the file because the file path is more than 259 characters"

Spreadsheet document

Summary

This post shows you how to fix Excel's Cannot open the file because the file path is more than 259 characters error by moving the workbook to a shallower folder in File Explorer or shortening its parent folders in SharePoint.

Desktop Excel counts the entire local path on your PC, from the drive letter through your Windows user folder, OneDrive shortcut name, every parent folder, and the .xlsx filename:

Complete Excel warning suggesting shortening the path or filename

Choose one approach based on whether you can move the file:

Why Excel blocks workbooks past 259 characters

When you open a downloaded workbook whose full local path exceeds 259 characters, desktop Excel stops and displays: Cannot open the file because the file path is more than 259 characters. Try shortening the path or filename.

Excel showing the more-than-259-characters path warning before the locally available workbook was moved

Shortening the filename alone often is not enough because OneDrive prepends your Windows user folder and company name to every synced file. As shown in the SharePoint and OneDrive path-length guide, that local prefix adds over 100 characters before your folders and filename even start:

Diagram comparing the 95-character SharePoint cloud path and the 219-character Windows PC path for the same synced spreadsheet

Compare how desktop Excel handles downloaded workbooks across the 259-character boundary:

Full path on the PC Path in SharePoint Desktop Excel result
255 characters 281 characters Opens normally
258 characters 284 characters Opens normally
260 characters 286 characters Blocked by 259-character warning
262 characters 288 characters Blocked by 259-character warning

Desktop Excel enforces this 259-character check when opening the local file, even though all four paths are well under SharePoint's 400-character limit.

Option A: Move the workbook to a shallower folder

Use this option when you can move the workbook higher up in File Explorer. Moving the file to a shallower folder removes intermediate folder names from its path without shortening the workbook's own filename:

  1. Cut the workbook from its deep folder
    • Dismiss the Excel warning, close Excel, select the downloaded workbook in File Explorer, and click Cut (the scissors icon) on the toolbar:
The locally available workbook selected in its long source path, with File Explorer's Cut control highlighted
  1. Paste the workbook into a shallower folder
    • Open a folder closer to the top of your synced library and click Paste on the File Explorer toolbar:
The same workbook pasted into the shallower destination folder in File Explorer
  1. Open the workbook in Excel
    • Double-click the workbook in its new folder to open it in desktop Excel:
The same workbook displaying its worksheet in Excel after moving to a shallower folder

Moving the workbook to the top of the synced folder cuts its local PC path from 262 to 184 characters (and its SharePoint path from 288 to 210 characters), so Excel opens the worksheet immediately with its original filename intact.

Option B: Shorten parent folders

Use this option when the workbook needs to stay in its current folder hierarchy. Renaming one or two long parent folders in SharePoint shortens the synced path for every file inside them:

  1. Rename long parent folders in SharePoint
    • Select a long parent folder above the workbook in your SharePoint library, click Rename on the toolbar, enter a shorter name, and click Update.
    • Shorten a second folder if the local PC path still exceeds 259 characters. In the example below, renaming the top folder to Q3 removes 30 characters and renaming a deeper folder to Energy removes another 51 characters:
Two SharePoint Rename dialogs shortening the top parent folder to Q3 and the deeper folder to Energy
  1. Wait for OneDrive to sync and reopen the workbook
    • Once OneDrive syncs the renamed folders to your PC, open the workbook from its shorter path in File Explorer:
The original workbook open in Excel after shortening its parent folders

Shortening those two folders brings the workbook's local PC path down from 330 to 249 characters, allowing desktop Excel to open it directly from the synced folder.

If you cannot move the file or rename shared folders right now, you can also open the workbook in Excel for the web by following the browser-opening steps in the OneDrive cloud-operation guide.