Display console error if worksheet name is longer than allowed by Microsoft Excel, also partially fixed merged cells issue.
1.
While working on a project that involved exporting a spreadsheet with a lot of custom styling, I found that if a worksheet name is longer than 31 characters, Microsoft Excel will display the following popup error when you open the exported file:
"Excel found unreadable content in 'file-name.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes."
If you click "Ok", the popup closes and the file opens with all of the worksheet data intact, but with the worksheet names truncated to 31 characters.
This occurs in both Microsoft Excel 2007 and Microsoft Excel 2013 (does not affect OpenOffice 4, LibreOffice unknown).
Causing excel-builder.js to thrown an error when a worksheet name is too long would not be backward compatible and should not be done since the issue does not affect software such as OpenOffice.
Instead of leaving the developer wondering why Excel displays an error popup when opening an exported workbook, we should display a console.log message (if a console is present) so that the developer can quickly identify and decide how to handle the issue.
2.
The popup is also displayed whenever opening an exported workbook containing cells merged by calling Worksheet.mergeCells().
After clicking "Ok", Excel opens, but the worksheet is blank and no data is loaded.  This occurs in both Microsoft Excel 2007 and Microsoft Excel 2013 (does not affect OpenOffice 4, LibreOffice unknown).
The partial solution is to write the 'mergeCells' XML tag to the "xl/worksheets/sheet#.xml" file before the 'pageSetup', 'drawing', 'headerFooter', and 'tableParts' tags.
There are still issues, for example the workbook exported from the demo/demo.html example page looses it's table definition metadata and auto filter columns.
The data is still present, but the columns are not filterable and the table's columns and size are not defined (even though the definition still exists in the the workbook's "xl/tables/table#.xml" file)
The partial solution is to reorder writing the 'mergeCells' and 'drawing' xml tags.