The "path too long" error in Excel means the full path to a file—drive letter, folders, and filename—exceeds Windows' classic 260-character limit. The fix is to shorten the path, enable long-path support in Windows, or move the file to a shallower folder. This guide walks through each method in order, starting with the simplest.
What You'll Need
- A Windows PC (the error is a Windows limitation; Mac Excel does not enforce the same 260-character cap)
- Administrator rights if you plan to change the Windows long-path setting
- The full location of the file that triggers the error—you can copy it from File Explorer's address bar
- A recent Excel version (Microsoft 365 or Excel 2019 and later handle long paths better than older releases)
Step-by-Step
- Measure the path first. Open File Explorer, navigate to the file, and click the address bar. Copy the full path, paste it into Notepad, and count the characters. If it is over 260, that is your problem. The count includes the drive letter, every backslash, every folder name, and the filename with its extension.
- Shorten the filename. Rename the file to something brief—drop version numbers, dates, and long descriptive phrases. A 60-character filename cut to 20 characters can be enough to get under the limit. Right-click the file, choose Rename, and press Enter.
- Move the file up the folder tree. If the file sits in something like C:\Users\YourName\Documents\Projects\Client Work\2024\Q3\Reports\Final\, move it to C:\Reports\ or a similarly shallow folder. Drag it in File Explorer or use Cut and Paste. Excel will open it from the new location without complaint.
- Rename long parent folders. If you cannot move the file, shorten the folder names along the path. "Client Work" becomes "CW," "Quarterly Reports" becomes "QR." Do this one folder at a time and test opening the file after each change.
- Enable long-path support in Windows (Windows 10 and 11). Press Win+R, type gpedit.msc, and press Enter. Navigate to Computer Configuration > Administrative Templates > System > Filesystem. Double-click "Enable Win32 long paths," select Enabled, and click OK. On Windows Home editions where gpedit is unavailable, open Registry Editor (regedit) and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Set LongPathsEnabled to 1. Restart the PC. Note that menu labels can differ slightly by Windows version and region.
- Update Excel. Open Excel, go to File > Account > Update Options > Update Now. Newer builds respect the long-path setting more reliably than older ones.
- Test the file again. Double-click the file or open it from Excel's File > Open dialog. If it opens, you are done. If the error persists, repeat step 1 to confirm the path is now under 260 characters.
Common Mistakes
- Counting only the filename. The limit applies to the entire path, not just the file name. A short filename in a deeply nested folder still fails.
- Forgetting the extension. The .xlsx or .xlsm suffix counts toward the total. Do not overlook it when measuring.
- Changing the registry without a backup. Before editing LongPathsEnabled, export the key (File > Export in Registry Editor). A wrong value elsewhere in the registry can cause boot problems.
- Assuming OneDrive or SharePoint paths are exempt. Synced cloud folders often have very long local paths under C:\Users\YourName\OneDrive - Company Name\... and hit the same limit.
- Renaming folders that other workbooks reference. If formulas or links point to the old folder name, they will break. Check for external references before renaming.
Tips
- Keep a simple folder structure: no more than three or four levels deep for active workbooks.
- Use short, consistent folder names across projects—"2024\Q3" rather than "Fiscal Year 2024\Third Quarter Deliverables."
- If you regularly work with deeply nested files, map a network drive to the deep folder. The mapped drive letter replaces the long UNC path and buys you characters.
- Store working copies in a shallow folder like C:\Work and archive finished files elsewhere.
- When sharing files, put them in a top-level shared folder rather than nesting them inside personal directories.
Troubleshooting
The file still won't open after shortening the path. Close Excel completely, reopen it, and try again. If the file is on a network share, the server's path may be longer than what you see locally—check the full UNC path (\\server\share\...) rather than the mapped drive letter.
The long-path setting seems to have no effect. Confirm you restarted the PC. Check that the registry value is set to 1 (not "true" or a string). Also verify your Excel build is current; older versions ignore the setting.
You cannot rename a folder because it is in use. Close all Office apps, then try again. If a sync client (OneDrive, Dropbox) is running, pause syncing temporarily.
The error appears when saving, not opening. The destination path is too long. Save to a shorter path first, then move the file.
You need administrator help. If you cannot change Group Policy or the registry, ask your IT administrator—on managed machines those settings are often locked down.
Frequently Asked Questions
Why does Excel show a path-too-long error when other programs open the file fine?
Excel relies on older Windows file APIs that enforce the 260-character limit unless long-path support is enabled. Some other programs use newer APIs and are not affected.
Does this affect Mac Excel?
No. macOS does not impose the same 260-character path limit, so the error is specific to Windows.
Can I fix it without changing Windows settings?
Yes. Shortening the filename, moving the file to a shallower folder, or mapping a drive letter usually solves it without any system changes.
Will enabling long paths break other software?
It is a Windows-supported setting and generally safe, but some older applications may behave unexpectedly. Back up the registry key before changing it.
Does OneDrive cause this error?
It can. OneDrive sync folders often have long local paths. Moving the file out of the synced folder or shortening the folder names resolves it.
What is the maximum path length after enabling long paths?
Windows supports paths up to about 32,000 characters with the setting enabled, but individual apps may still impose their own limits.