With the latest release of Summer 16, some of you may be receiving a “File is corrupt and cannot be opened” error message with excel files generated from visualforce pages.

The fix for the issue is very simple – you were most likely including a tag at the end of your page, since it was not being automatically generated by visualforce. While we don’t see this mentioned in the release notes, that issue seems to have been fixed by Salesforce. If your working code has broken with the Summer 16 release, just remove the code to append the tag in your visualforce page and your issue should be resolved!

Here’s the link to the Salesforce.com Summer 16 release notes.