Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you open or save a file in Microsoft Excel: "Filename is not valid"


View products that this article applies to.

Error Message

When you open or save a file in Microsoft Excel, you may receive one of the following error messages:

Error message 1
Filename is not valid.
Error message 2
The file could not be accessed.
Error message 3
The path you entered, '<filename>', is too long. Enter a shorter path.
Error message 4
<Filename> could not be found. Check the spelling of the filename, and verify that the file location is correct.
Error message 5

In Microsoft Office Excel 2007, you may receive the following error message:
'<Filename>.<extension>' could not be found. Check the spelling of the file name, and verify that the file location is correct. If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file has not been renamed, moved, or deleted.
To verify the error message that you receive in Excel 2007, press Ctrl+Shift+I. The following number is displayed in the lower-right corner of this error message dialog box:
100202

Note Microsoft Office 2000 has built-in functionality that allows you to get more information about difficult-to-troubleshoot alerts or error messages.

Note If you reached this article by clicking the Web Info button in an error message, you already have Customizable Alerts enabled.

↑ Back to the top


Cause

This error message occurs when you save or open a file if the path to the file (including the file name) exceeds 218 characters. This limitation includes three characters representing the drive, the characters in folder names, the backslash character between folders, and the characters in the file name.


This behavior is based on a 256-character limitation in Excel for creating links to another file. This limit of 218 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 resemple the following:

'c:\excel\personal\...\[my workbook.xls]up_to_31_char_sheetname'!$A$1

Note This behavior will also occur if there is a square bracket in the path.

↑ Back to the top


What To Try

Make sure that the path to the file contains fewer than 219 characters. To do this, use one of the following methods:
  • 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.

↑ Back to the top


More Information

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 you entered, "<path>", is too long. Enter a shorter path.
Also, if you attempt to save a file and the path exceeds 255 characters, you will receive the following error message:
The file could not be accessed. Try one of the following:

- Make sure the specified folder exists.
- Make sure the folder that contains the file is not read-only.
- Make sure the file name does not contain any of the following characters: < > ? [ ] : | *.
- Make sure the file/path name doesn't contain more than 218 characters.

↑ Back to the top


Keywords: kbofficealertid, kbtshoot, kbdownload, kberrmsg, kbfix, kbprb, ocswin2kswept, offexterr, kbbillprodsweep, kb, 2000rtmpublic

↑ Back to the top

Article Info
Article ID : 213983
Revision : 10
Created on : 8/20/2020
Published on : 8/21/2020
Exists online : False
Views : 547