Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interop.Excel question

Status
Not open for further replies.

TeaAddictedGeek

Programmer
Apr 23, 1999
271
US
I'm working with Excel 2003 and .NET 1.1 using the Interop.Excel functionality. It seems to me that there is no way to grab whether or not the Excel range.Cells is a Date value versus a number. Is this really the case, and if not, what functionality am I somehow missing?

I've looked at the "Get_Type" but it returns a String for the .Text field (obviously) and a Double for .Value2, which it returns as a mess of numbers that apparently only Excel can understand.

Is there any way to test for a Date value from a returned Excel field in C# straight from the Range.Cells object versus using C# to test the .Text value? So far I've only found "NumberFormat" which can be any mess of date formats and no clean way of determining if it's a date format or not (ie., could be m/d/yyyy, mm/d/yy, etc.).


Thanks!

[morning]

"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top