Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: XLWorkbook.Save causes spreadsheet to lose data

$
0
0
It looks like immediately after opening the spreadsheet using new XLWorkbook(...), the data in the original hasn't been loaded into memory:

(new System.Linq.SystemCore_EnumerableDebugView<ClosedXML.Excel.IXLWorksheet>(((ClosedXML.Excel.XLWorksheets)(spreadsheet.Worksheets)))).Items[10].Cell(2,1).Value

The above code returns an empty string, even though the original worksheet has a user's name in that cell. And so when I save the XLWorkbook, naturally the empty value gets saved resulting in the data loss about which I'm complaining.

Interestingly, ...Cell(1,1).Value returns "UserName" which is correct--it's the value of the cell serving as the column header.

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>