Finding Excel errors in cells


#1

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

#2

How about a new property: IsErrorValue?

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

}


#3

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

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

Luigi




#4

Hi Luigi,

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


#5

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

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

Luigi


#6

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


#7

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.