Suggestion to improve 'toExcel' method

MS Excel sheet names are subject to certain rules: max 31 characters and they can not contain certain reserved characters. The method ‘toExcel’ has a property ‘name’, but it does not validate these rules. If an invalid sheet name is passed into this property, toExcel still creates a workbook without returning an error, but MS Excel refuses to open the workbook (“this workbook is corrupt”).

It might be best to have the method either return an elegant error, or apply the below to the ‘name’ property to avoid such errors:

name.replace(/\/|\\|\[|\]|\*|\?|:|&/g, ‘’).substring(0, 31)

Hello,

Many thanks for the useful suggestion !