qrilka / xlsx

Simple and incomplete Excel file parser/writer
MIT License
132 stars 64 forks source link

We shouldn't be able to make sheetnames bigger then 31 characters. #155

Open jappeace opened 2 years ago

jappeace commented 2 years ago

The reason is that excell claims the worksheet "may contain a virus" if it detects this. Excell validator explain this:

File: xlsx/avy.xlsx
Error: The attribute 'name' has invalid value 'Gross written premium (calendar years)'. The actual length is greater than the MaxLength value. The length must be smaller than or equal to 31.
ContentType: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml
XPath: /x:workbook[1]/x:sheets[1]/x:sheet[1]
vrom911 commented 6 months ago

Additionally to that, here are all the conditions on the sheet names:

We could introduce "safe" function like createSafeSheetName for these checks.