Microsoft KB Archive/247799

= XL98: Programmatically Exporting Text File Truncates Dates =

Article ID: 247799

Article Last Modified on 9/12/2006

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q247799





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</li> xlCurrentPlatformText</li> xlDIF</li> xlTextMac</li> xlTextMSDOS</li> xlTextPrinter</li> xlTextWindows</li></ul>

-and-

</li> The Show century setting in the Date & Time Control Panel is enabled.</li></ul>

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.

<div class="resolution_section">

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 XL98: How to Obtain and Install the Excel 98 Y2K Update

<div class="moreinformation_section">

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

Additional query words: XL98 y2k

Keywords: kbprb kbdtacode KB247799

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.