"Filename Is Not Valid" Error Saving or Opening File

This article was previously published under Q131464
This article has been archived. It is offered "as is" and will no longer be updated.
When you open or save a file in Microsoft Excel, you may receive one ofthe following error messages:
Filename is not valid
The file could not be accessed.
The path you entered, '<filename>', is too long. Enter a shorter path.
<Filename> could not be found. Check the spelling of the filename, and verify that the file location is correct.
This error message occurs when you save or open a file if the path to thefile (including the file name) exceeds 219 characters. This limitationincludes three characters representing the drive, the characters in foldernames, the backslash character between folders, and the characters in the file name.

This behavior is based on a 256-character limitation in Excel for creatinglinks to another file. This limit of 219 characters for the path name is based on the following:
  • Up to 31 characters in a sheet name
  • Apostrophes and brackets used to denote the workbook name
  • An exclamation point
  • A cell reference
For example, the path for a file might be:

   'c:\excel\personal\...\[my workbook.xls]up_to_31_char_sheetname'!$A$1				
Make sure that the path to the file contains fewer than219 characters. You can do this by using one of the followingmethods:
  • Rename the file so that it has a shorter name.

  • Rename one or more folders that contain the file so that they have shorter names.

  • Move the file to a folder with a shorter path name.

Microsoft Excel

Note that if you enter 255 characters in the File Name box in the Save As dialog box, and click OK, you will receive the following error message:
The path '<filename>' exceeds 255 characters.
and you cannot save the file. When you save a file in Microsoft Excel, ifthe number of characters in the file path exceeds 255, the MicrosoftWindows limit, then you receive the "path exceeds 255 characters" errormessage instead of the "filename is not valid" error message.

Windows 95

In Microsoft Windows 95, the limitation for the path name for afile is 255 characters. When you rename a file in Explorer or My Computer,you are unable to type more characters when you reach the 255 characterlimit for the path to the file.

If you move a file to a subfolder where the path would exceed 255characters, you receive the following error message:
Cannot move <filename>: the filename you specified is invalid or too long. Specify a different filename.
8.00 97 XL97 218 XL

Article ID: 131464 - Last Review: 12/04/2015 11:29:34 - Revision: 1.3

Microsoft Excel 97 Standard Edition, Microsoft Excel 95 Standard Edition

  • kbnosurvey kbarchive KB131464