Problem
When trying to open an Excel spreadsheet exported from a list view, the following message shows up in Excel:
We found a problem with some content in '{file name}.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook,click Yes.
Solution
Microsoft Excel has a character limit of 32,767 for each cell. If there is value in a record retrieved by your list view that contains more than 32,767 characters, you can still export the records to Excel without any issue, but Microsoft Excel will display the above message when you try to open the exported file.
To avoid this, the only workaround is to identify which column will likely contain values more than 32,767 characters, and limit the number of characters that will be returned in a column to 32,767.For example, if your list view are displaying results from a SQL stored procedure, you can update your stored procedure to truncate a column's value if it exceeds 32,767 characters, and only display the first 32,767 characters. If you want to display the entire value, you have to consider splitting the value into multiple columns, with each column not exceeding 32,767 characters.