View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default "1/1/1799" - is a date

Simon,

Excel doesn't support dates prior to 1-Jan-1900. Thus, 1/1/1799
is merely a text string.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Simon Woods" wrote in
message ...
Hi

How do I programmatically set a cell to accept "1/1/1799" as a

date.

If I pass it in and then reset the NumberFormat of the cell or

the column it
continues to see it as a string,

e.g.
MySheet.Cell(1,1).NumberFormat = "dd/mm/yyyy"
MySheet.Cell(1,1).FormulaR1C1 = Cstr(DateValue("1/1/1799"))

So if I want to show it as 01-Jan-1799 it refuses(!) to see it

as a date
and continues to show 1/1/1799

Thanks

Simon