I have stripped our use down to be a very simple data-dump.
Row 1 = column headers
Rows 2 to N = data
I am using the auto filtering feature
sheet.Filter.FilterRange = sheet.UsedCellRange;
once all the data has been written
File is being saved
IWorkbookFormatProvider XSLXwriter = new XlsxFormatProvider();
using (FileStream filestream = new FileStream(filename, FileMode.Create))
Output is a Workbook and filename is a unique string.
I am simulating a user experience of wanting to us the sorting options provided within Excel however this causes a crash and the file to be recovered. Saving and re-opening fixes this problem. Comparing workbook.xml from the before(which crashes) and after(save as copy) it looks like this is missing.
<definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">Sheet1!$A$1:$GJ$531</definedName>
If you could advise on solving this issue it would be great.