OWC 10 - #n/a, #name, #value detection

N

nalenb

Hi, I'm using owc 10 to read the values on an xml spreadsheet in a
vb.net application. In some cells we have #n/a (formula =na(), though
sometimes the value has cascaded from other computations). When I grab
the range into an object array like:

dim outputs as object =
wb.Worksheets.Item("Output").Range("b1:n116").Value

I get an array I can iterate over. However, all of the cells that show
as #n/a, #name, or #value show up as an Integer object with the value
of -2146826246. Is there a way to tell if the cell has a #n/a, #name
or #value entry?

Thanks
Bill
 
A

Alvin Bruney [MVP]

Not that I know of. This isn't even possible outside of OWC. You have to
examine the contents of the cell.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
N

nalenb

Not that I know of. This isn't even possible outside of OWC. You have to
examine the contents of the cell.

How do I examine the contents of the cell? I don't see anything on the
Range object that will let me look at the contents of the cell.

Thanks
Bill
 
J

Josh Sale

Bill,

This is just another of the maddening, apparently capricious changes in the
OWC object model from the Excel object model. To do what you want to do in
Excel you would simply:

Range.SpecialCells(xlCellTypeFormulas, xlErrors)

Unfortunately, the OWC folks in their infinite wisdom decided that nobody
needed the SpecialCells method and so failed to bring it over from Excel.
Why? I don't know.

To look at the contents of a cell, you use it's Value property. However
when a cell is in error, I don't think it has any value in a conventional
sense.

josh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top