The information in this article applies to:
SYMPTOMSIn Visual Basic for Applications, when you use the BuiltinDocumentProperties or CustomDocumentProperties property to set a date prior to January 1, 1980, or after December 31, 1999, and if you use two digits for the year (that is, you use the "mm/dd/yy" format), a date value you do not expect may be returned. For example, when you run the following procedure
a message box displays the value "11/30/79" instead of "1/1/04."
CAUSE
The mm/dd/yy date sequence is a carry-over from the original 8-bit number
storage design of the hardware and software from the first PC design. In
the original design, the default first date was 01/01/80 and no allowance
was made for dates beyond 12/31/99. Any value outside the old range is not
recognized as valid.
WORKAROUND
If a date is outside the old default range of 01/01/80 to 12/31/99, add the
century to the date; that is, use the form "mm/dd/yyyy."
http://www.microsoft.com/support/supportnet/overview/overview.aspFor example, when you use the following lines in your procedure
a fully qualified date will be evaluated (this date it is expressed without
system interpolation).
NOTE: The syntax forms mm/dd/yy and mm/dd/yyyy refer to the actual cell or variable contents; they do not refer to formatting applied to cells on a worksheet. STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONFor additional information on dates in Microsoft Excel, please see the following article in the Microsoft Knowledge Base: Q164406 XL: How Microsoft Excel Works with Two-Digit Year Numbers Additional query words:
Keywords : kbprg xlwin |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |