There should be a warning if Title of Sheet exceeds 31 characters
In the Microsoft Excel UI, it is not possible to type in more than 31 characters into the title of a Sheet.
However, in openpyxl, we can create a sheet with a title longer than 36 characters. There is no failure or warning.
I propose that if the title exceeds 36 characters, it should either fail with a clear error message or print a clear warning to console.
The result is that when you try to open the Excel created with a title longer than 36 characters, you receive a cryptic warning:
We found a problem with some content in 'test.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.
Upon clicking yes:
The log file contains this XML which isn't helpful:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error102320_05.xml</logFileName><summary>Errors were detected in file 'C:\suml\suml\test.xlsx'</summary><repairedRecords><repairedRecord>Repaired Records: Worksheet properties from /xl/workbook.xml part (Workbook)</repairedRecord></repairedRecords></recoveryLog>
It took me a while to hunt down the reason for this.
More information can be found here: https://stackoverflow.com/questions/3681868/is-there-a-limit-on-an-excel-worksheets-name-length
Thanks.