[FIX] Error in excel export when sheet name > 31 characters

XLWT only accepts sheet names smaller than 31 characters because that's the
excel limit.

Fixes #2548
Fixes #3318