On Tue, Jun 21, 2011 at 9:50 PM, Jon Svede <[email protected]> wrote: > The javdoc spells out that limitation but I agree with you, I think it should > throw an exception. > Not exactly, the rule is more complex.
Non Excel clients such as OpenOffice allow opening / editing of worksheets with names longer than 31 characters. Some time back I loosened the 31 characters constraint to support that. That seemed to be OK for Excel 2003, Excel 2007 and OpenOffice. They all were able to open workbooks with long sheet names. Now I'm testing in Excel 2010 and it fails to open .xlsx. The test synopsis is below: XLS format: [OK] Excel 2003 can open .xls files with long sheet names without error or warning. The sheet tab shows the full name. [OK] Excel 2007 can open .xls files with long sheet names without error or warning. The sheet name is silently truncated to 31 characters. [OK] Excel 2010 can open .xls files with long sheet names without error or warning. The sheet name is silently truncated to 31 characters. XLSX format: [OK] Excel 2007 can open .xls files with long sheet names without error or warning. The sheet name is silently truncated to 31 characters. [FAILURE] Excel 2010 failes to open .xlsx files with sheet names longer than 31 characters. I'm inclined to revert my previous change and always enforce the 31 characters rule. The question is what to do if the sheetName argument is long? Throw IllegalArgumentException or silently truncate to 31 chars? Yegor --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
