XL2000: Programmatically Exporting Text File Truncates Dates

This article was previously published under Q247796
This article has been archived. It is offered "as is" and will no longer be updated.
For a Microsoft Excel 98 Macintosh Edition version of this article, see 247799.
For a Microsoft Excel 97 version of this article, see 247801.
For a Microsoft Excel 7.0 version of this article, see 249033.
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.
This behavior occurs when the following conditions are true:
  • You use the SaveAs method to save the contents of your Excel worksheet.


  • 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
    • xlUnicodeText


  • The Short date style setting under Regional Settings in Control Panel is set to a format displaying four-digit years.
By design, Excel uses the default Short date style setting (m/d/yy) for the U.S. English version of Windows 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.
A Microsoft Excel 2000 Programmatic Text Export Updatethat corrects this problem is available for download from the followint Microsoft Web site:
Cells that contain custom formatting are not affected by this behavior.
XL2000 y2k

Article ID: 247796 - Last Review: 02/28/2014 00:29:43 - Revision: 3.4

  • Microsoft Excel 2000 Standard Edition
  • kbnosurvey kbarchive kbhotfixserver kbqfe kbdownload kbdtacode kbofficeupdate kbpending kbprb KB247796