Article ID: 247799 - Last Review: September 12, 2006 - Revision: 2.2

XL98: Programmatically Exporting Text File Truncates Dates

This article was previously published under Q247799
Expand all | Collapse all

SYMPTOMS

When you programmatically save the contents of your Microsoft Excel worksheet, some dates that were stored with a four-digit year are truncated to two-digit years.

CAUSE

This behavior occurs when the following conditions are true:
  • You use the SaveAs method to save the contents of your Excel worksheet.

    -and-

  • You specify one of the following parameters for the FileFormat argument of the SaveAs method:

    • xlCSV
    • xlCSVMac
    • xlCSVMSDOS
    • xlCSVWindows
    • xlCurrentPlatformText
    • xlDIF
    • xlTextMac
    • xlTextMSDOS
    • xlTextPrinter
    • xlTextWindows

    -and-

  • The Show century setting in the Date & Time Control Panel is enabled.
By design, Excel uses the default short date style setting (m/d/yy) of the Mac OS to determine the format for exporting your worksheet to one of the file formats listed above. This maintains consistent, predictable automation results, regardless of locale settings.

RESOLUTION

To resolve this problem, download and install the Excel 98 Y2K Update. For additional information about how to download and install the Excel 98 Y2K Update, click the article number below to view the article in the Microsoft Knowledge Base:
249227  (http://support.microsoft.com/kb/249227/EN-US/ ) XL98: How to Obtain and Install the Excel 98 Y2K Update

MORE INFORMATION

Cells that contain custom formatting are not affected by this behavior.

APPLIES TO
  • Microsoft Excel 98 for Macintosh
Keywords: 
kbdtacode kbprb KB247799
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations