Share via

Excel can't open .xls files, includes filename in invalid character error message.

Samantha Corless 0 Reputation points
2026-03-11T20:15:57.7566667+00:00

Hi, I am an IT professional who has encountered an odd behaviour when Excel LTSC 2024 opens up .xls files. When opening up the file, it would show the error for a file with invalid characters, path, or a missing file. However, I confirmed none of the files that show the error have invalid characters, have a path within 218 characters in length, and they do indeed exist.

The oddest part is that the invalid character messages replaces what would otherwise be a "|" (Pipe) character with the files' filename. Like if the file was located in the following path;

C:\Users\<user>\Downloads\filename.xls

The error message that pops up says;

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 filename and folder path do not contain any of the following character < > ? [] : filename.xls or *
- Make sure the filename and folder path do not contain more than 218 characters.

Seems like there's an odd issue where the parser for invalid filenames is somehow including the name of the file in its invalid character rules. Or at least that's my speculation.

Microsoft 365 and Office | Excel | Other | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Nam-D 2,410 Reputation points Microsoft External Staff Moderator
    2026-03-12T09:07:57.3533333+00:00

    Hello @Samantha Corless,

    It appears that you are encountering Excel’s generic “invalid character or path” error dialog even though your .xls files and their paths look normal.  

    This happens because Excel LTSC 2024 still enforces strict filename and path rules when opening files from File Explorer or other external locations. Excel does not fully support certain characters anywhere in the filename or in any folder along the path, including < > ? [ ] : | *, and it also enforces the legacy 218‑character path limit.  

    To narrow down the issue, try opening the same file directly from inside Excel using File > Open > Browse, because Excel’s restriction applies mainly when opening a workbook from outside the application. Also test by moving the file to a simple location such as C:\Temp\a.xls, which helps confirm whether the issue is related to path length or a parent folder name.  

    If the file still does not open, use Excel’s Open and Repair option to rule out hidden file‑format or corruption issues.  

    In case all checks have passed but the issue still persists, kindly share the exact full path of one affected file (with personal details removed) so that I can help you check whether a folder name or path length might be triggering the error.  

    Note: Please understand that as a forum moderator, my primary goal is to provide helpful guidance and support through general troubleshooting steps. While I don’t have access to internal systems or test devices required to resolve backend/account issues, I truly appreciate your understanding of these limitations.   

    I hope you find this information helpful. If anything is unclear, please don’t hesitate to reach out to me.  


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any extra questions about this answer, please click "Comment."    

    If you want to receive the related email notification for this thread, please follow the steps in our documentation to enable e-mail notifications. 

     

    0 comments No comments

  2. Q&A Assist
    2026-03-11T20:16:14.1566667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Excel LTSC 2024 is enforcing the standard filename and path validation rules that block certain characters, including the pipe character |, and is surfacing the generic error text that lists the disallowed characters and the 218‑character path limit for Excel.

    In current Excel versions, the following apply when opening from outside Excel (Explorer, a shortcut, a mapped drive, UNC, or URL):

    1. Excel does not fully support these characters in the filename or any folder in the path:
      • [ ]
      • ?
      • < >
      • :
      • |
      • *
    2. When such a character is present, or when Excel thinks it is present, the error shown is:
      • “The file could not be accessed. Try one of the following: … Make sure the filename and folder path do not contain any of the following characters: < > ? [ ] : | or *. … Make sure the filename and folder path do not contain more than 218 characters.”
    3. For Excel specifically, the total path length limit is 218 characters (including drive letter, all folder names, backslashes, filename, and extension). If that limit is exceeded, the same family of errors appears (“The file could not be accessed”, “Filename is not valid”, or “The path you entered is too long”).

    The behavior described (the filename text appearing where the | character should be listed in the error message) is a display/formatting issue in the error string, not a change in the underlying rules. Excel is still checking for the standard invalid characters and the 218‑character limit; the message text is just being constructed incorrectly in this case.

    From an operational standpoint:

    1. Confirm the actual full path length of the affected .xls files, including:
      • Drive (e.g., C:)
      • All folder names and backslashes
      • Filename and .xls extension and ensure it is under 218 characters.
    2. Confirm that neither the filename nor any folder in the path contains any of the disallowed characters < > ? [ ] : | *.
    3. If the file opens when using Excel’s in‑app Open command but not from Explorer or a shortcut, this matches the documented limitation: opening such paths from outside Excel is not fully supported even if it sometimes works from within Excel.
    4. As a workaround for any file that triggers this error when opened from outside Excel:
      • Use File Explorer to rename the file and/or its parent folders to remove any disallowed characters.
      • If the path is long, move the file to a shorter path (for example, closer to the root of the drive) so that the total path length is well under 218 characters.

    If all paths and names are clean and short and the issue persists only on specific machines, collect an example path and test on another machine with the same Excel build to determine whether this is a machine‑specific configuration issue or a broader product bug. In either case, the supported mitigation remains to avoid disallowed characters and overly long paths.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.