Finding Excel errors in cells

Hi,

we are using Aspose.Excel to transfer data from Excel Sheets to database tables.

We are now coping with Excel errors in individual cells. Our aim is to abort database loading if any of the cells contains an Excel error, like one of these (if you know of any other, pls tell me!):

#REF!
#DIV/0!
#N/A
#NAME?
#NUM!
#VALUE!
#NULL

Which is the best way to find if a cell has an error?
Should we use StringValue property of Cell objects to find if a cell has one of these errors?



if (cell.StringValue == “#REF!” || cell.StringValue = “DIV/0!” || (…) )



I find this solution quite unelegant: let’s say the user wants to insert one of the error codes as valid strings. In this case this check would stop the data transfer…

Thank you for help,

Luigi

How about a new property: IsErrorValue?

if(cell.IsFormula)
{
if(cell.IsErrorValue)

}

You mean you could add these two attributes to Cell class?

Huh, I believe one couldn’t ask for more…!

Luigi



Hi Luigi,

Please try this attached fix. These two properties are all supported.

I've just downloaded the fix and I am going to try it.

As always, your customer service is above any expectations...

Luigi

The fix works as expected.

Thank you.

Question:

how is it possible to know if the fix is included in latest release ufficial of Aspose.Excel?

Luigi

You can right-click to check the version number of the dll to verify if it’s included in the official release. For example, this fix is v3.4.4.3. It’s included in our official released v3.4.5 and later version.