I'm generating a spreadsheet, where sometimes the data comes out as NaN. Not a problem
However, when I "SaveAsExcel", and go to open the spreadsheet in Excel 2016 I get "We found a problem with some content in 'reportname'. Do you want us to try and recover as much as we can? If you trust the source of this workbook, click yes" Clicking yes and I get that Excel was able to open the file with the following:
"Repaired Records: Cell information from /xl/worksheets/sheet1.xml part"
and a link to a log file which shows... Nothing
error072200_01.xmlErrors were detected in file MyFileName.xlsx'Repaired Records: Cell information from /xl/worksheets/sheet1.xml part
Now if I delete the NaNs on the sheet, I have NO issues. Anyone have a clue how I can fix this?
I've recreated the problem and also suggested a solution - Go over all the cells of the sheet and check if the cell's value is
NaNand validated as a number, if so, change the value to "".You can change the solution to something that will fit your needs better of course.