Export functionality in getWBook() should limit sheet names to 31 characters so that when the spreadsheet is opened in Excel, it does not cause an error. Excel requires tab names < 32 characters long.
I modified getWBook to call a getUniqueSheetName function that keeps track of used names and returns:
verylongnamethatcrashesexcelverylongnamethatcrashesexcel
anotherverylongnamethatcrashesexcelverylongnamethatcrashesexcel
athirdverylongnamethatcrashesexcelverylongnamethatcrashesexcel
-->
verylongnamethatcrashesexcelver
verylongnamethatcrashesexcelve2
verylongnamethatcrashesexcelve3