Created attachment 201785 [details] Sample XLSX The attached test file, which was based on an issue seen with forum-mso-de-122145.xlsx (also attached), was created in Excel by adding autofilter to a minimal set of data (2 columns), and sorting the first column in the filter. Open and save it back to XLSX, then try opening it in Excel. => Excel fails to open the file cleanly, and claims it found a problem with the file. After attempting recovery, the file opens without further message. This is the relevant part from xl/worksheets/sheet1.xml: <autoFilter ref="A3:B3"> <sortState ref="A4:B6"> <sortCondition ref="A3"/> </sortState> </autoFilter> Here's the same part from the exported file: <autoFilter ref="A3:B3"> <sortState ref="A4:B3"> <sortCondition ref="A4:A3" customList=""/> </sortState> </autoFilter> Note the 'sortState' ref, which is an invalid range: "A4:B3", and the 'sortCondition' ref, where "A4:A3" is equally invalid. This issue is an implementation error in 7.1 from the following commit: https://git.libreoffice.org/core/commit/a9f8f0a484965338221cad4f97d98f418b5ccff1 https://cgit.freedesktop.org/libreoffice/core/commit/?id=a9f8f0a484965338221cad4f97d98f418b5ccff1 author Serge Krot <Serge.Krot@cib.de> 2020-06-29 13:23:34 +0200 committer Thorsten Behrens <Thorsten.Behrens@CIB.de> 2020-09-08 12:51:17 +0200 "tdf#95640 XLSX: import/export of custom sort lists" Before that, the same exported XML part looked like this (no 'sortState' was exported): <autoFilter ref="A3:B3"/> Still in LO 26.2.0.0.alpha0+ (697fadb8f4efdc09091088261ca1b43984c029b4) / Windows. A specialty of this file is that the autofilter was created in Excel by selecting the header cells, and those only, and clicking the filter button. Selecting the whole data area, and creating the autofilter that way will produce different XML that doesn't exhibit the bug.
Created attachment 201786 [details] forum-mso-de-122145.xlsx
likely a variant of an issue ignored since 5 years, calc has only one setting and mixes up use for sort and filtering or the like, see: #133529