Person reports a problem. I can't replicate it whatsoever. Dug into the code. Dug some more. Dug even more. Then I decided to go back to square one and enter the data they did, in the order they did, and follow the exact steps.

Sure enough, the problem appeared. But why? The issue was a corrupted Excel file being generated, but this made no sense give that the same report is generated hundreds of times per day and works just fine for everyone else.

Unzipped the .xlsx file and dug into that lovely mess that is MS-XML. Found, way at the bottom of the "Shared Strings.xml" file an ampersand that was showing as being illegal.

Whoops. The text going from the database into Excel was not having certain characters converted into HTML entities first. It would only appear when a manager would write a comment that included an ampersand, which is why it was intermittent.

My bad on this 😑