ClosedXml exception when opening an Excel sheet.

We handle may Excel sheets in our automated systems and we use the great ClosedXml opensource library (https://closedxml.codeplex.com/). However today we stumbled upon a sheet that crashed one of our applications.

InvalidOperationException: Sequence contains no matching elements.

After downloading the ClosedXml source I found out the sheet had a rogue comment. Somehow this comment did not have the shapetype that ClosedXml expected. After removing it everything ran smoothly again.

It seems I am, for the first time, going to make a bugfix contribution to an opensource project….

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.