Created attachment 33313 [details] Fixed validateName The documentation for HSSFName.setNameName says, that ist ist allowed to use "\" as first character in the name. The function validateName prevents the use of "\" as first character. Fix is attached as git patch.
I tried to find an official Microsoft webpage stating the sheet naming rules but came up short. This forum [1] mentions there is no official site, but reiterates the error dialog given by Excel when a user tries to enter in an invalid name. I think this may be an incomplete list of rules, for example, a single apostrophe (if this is allowed, I'm guessing some of our CellAddress-related scripts fail when parsing a "'Some Chick'n'!A1". This should be added as a unit test, with expected pass or fail depending on Excel and OpenOffice/LibreOffice behavior). The Excel error dialog: """You typed in an invalid name for a sheet or chart. Make sure that: The name that you type does not exceed 31 characters. The name does not contain any of the following characters: : \ / ? * [ or ] You did not leave the name blank.""" This forum also mentions the sheet name "History" is off-limits. I wonder if formula names are valid--maybe a formula and a new (sheet name or named range) can be differentiated by the presence of an open parenthesis. [1] https://social.technet.microsoft.com/Forums/office/en-US/5627d4c3-6023-4ca7-b3d4-f93419e3b560/what-are-the-rules-for-the-name-of-an-excel-worksheet?forum=excel