In Java, we're using the following package to programmatically create excel documents:
org.apache.poi.hssf
If you attempt to set a sheet's name (NOT file, but internal Excel sheet), you will get an error if:
- The name is over 31 characters
- The name contains any of the following characters: / \ * ? [ ]
However, after creating a document with a sheet name of:
!@#$%&()+~`"':;,.|
No error is output, and everything seems fine in Java. When you open the excel file in Office 2003, it will give you an error saying that the sheet name was invalid and that it renamed it to something generic like "Sheet 1".
I don't know much about the previously stated package that we're using, but it looks like it's not correctly filtering invalid Excel sheet names. Any idea of how I can filter out all known invalid characters? I'm hesitant to simply filter out all non-word characters.