Skip to content

Em Dash and En Dash in Excel Table Name #4461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
juandelacruz011385 opened this issue May 5, 2025 · 3 comments
Open

Em Dash and En Dash in Excel Table Name #4461

juandelacruz011385 opened this issue May 5, 2025 · 3 comments

Comments

@juandelacruz011385
Copy link

Hi,

I am loading an excel file that has a table with a name of "Test—Only" the dash is an em-dash which should be allowed as table name in excel.

currently it is throwing an error The table name contains invalid characters.

Is it possible for phpspreadsheet to also allow the em-dash and en-dash as an allowed characters for the table name?

@oleibman
Copy link
Collaborator

oleibman commented May 5, 2025

It probably would not be difficult, but ... your example notwithstanding, I don't see anything which says that dashes can be part of a table name. Please see, for example, https://support.microsoft.com/en-us/office/rename-an-excel-table-fbf49a4f-82a3-43eb-8ba2-44d21233b114. I will keep searching, and, if you can point me to something which says they are permitted, so much the better.

@juandelacruz011385
Copy link
Author

thank you for the response.

i just simply use the en-dash and em-dash as a name for the table and it did not show any validation/errors unlike using a normal dash.

Here's a simple file

Sheet – Name.xlsx

@oleibman
Copy link
Collaborator

oleibman commented May 6, 2025

I know that your example works. However it does not conform to what Excel says (in many places) that it allows. I have found other non-conforming characters that work as well. Feature? Bug? Who knows? I do not want to be in the business of having to figure out what Excel actually supports as opposed to what it says it supports. In your case, I would suggest using underscores rather than dashes. Sorry for this disappointing response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants