View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default What Range property distinguishes a double from a datetime?

I could be wrong but I don't think Excel understands DATETIME although a cell
format can show it. The closest is

typename(Range("c1").value)

would return Date if c1 contains a timestamp or a date.

"LJ" wrote:

I am using vs2005 and c#.

I am passing a range object into C# and trying to determine what type
of value it is. In case it's a datetime I want to convert it using
DateTime.FromOADate. I can't find the right property to help me
distinguish a datetime from a double. Excel seems to know. I see the
Range.NumberFormat looks different but using this seems like a real
kludge.