MarkPflug / Sylvan.Data.Excel

The fastest .NET library for reading Excel data files.
MIT License
243 stars 30 forks source link

Write Double.NaN #176

Closed yiyinghu97 closed 5 months ago

yiyinghu97 commented 5 months ago

Hi, When I try to open the excel file generated by the Sylvan.Excel. I get the following error. "We found a preblem with some content in 'xxx.xlsx'. Do you want us try to recover as much as we can? If you trust the source of this workbook, clik Yes." The code is attached below. ` public void SylvanExcelTest() { var data = new[] { double.NaN, 1.2 }.Select(v => new { Value = v });

 var reader = data.AsDataReader();
 using (var w = ExcelDataWriter.Create("D:\\test2.xlsx"))
 {
     w.Write(reader);
 }

} `

MarkPflug commented 5 months ago

Yep, this was a bug. It has been fixed with #177, and will be included in the next release.