View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default VSTO Date Evaluation

Hi Bob,

I haven't got VS.NET available to test this at the moment, but how about
something like this:

DateTime day_to_process =
DateTime.Parse((Excel.Range)rngLookup.Cells[8,6]).Text);

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

"Bob Sullentrup" wrote in message
...
Folks,

I have a cell (F8) containing 7/14/2005, which translates to 38547 in the
C#
code-behind.

I can translate 38547 to 7/14/2005 with the following:

day_to_process =
(Convert.ToDateTime("12/30/1899")).AddDays(Convert.ToDouble(((Excel.Range)rng Lookup.Cells[8,6]).Value2.ToString()));

Anybody have a better way?

--
Bob Sullentrup