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

Commented Unassigned: ClosedXML.Excel.IXLRow.Cell() returning wrong values [9375]

$
0
0
There is a bug in the ClosedXML.Excel.IXLRow.Cell() function.
I open a workbook and access a worksheet. The worksheet has only one row, so row.Rownumber returns 1.
I access the second row of the sheet with worksheet.Row(2). Now lastUsedRow-Rownumber is 2.
Accessing row.Cell(1) returns the value of the first row's first cell.

I think in this case an exception should be thrown like NoExistingCell instead of returning the value from a different row.

Documentation says "Gets the cell in the specified column.". But what about the specified row?
It does not say "returns the cell form he specified column in the last used row."

This bug makes comparing two Excel-Files really difficult.
Dont know the algorithm, but accessing a not existing cell shoult throw an error.

Attached the Excel-Rows and visual studio immediate-output.



Comments: So you say I should ask all users of my program to put in some correct data into the excel-file? And what should be the message i give the users? "The developer of closedxml cannot manage an empty row. Put in some input in the row under the heading"? This code was just an exsample. The error apears in code with more filled rows too.

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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