XL2000: Programmatically Exporting Text File Truncates Dates
ID: Q247796
|
The information in this article applies to:
-
Microsoft Excel 2000, used with:
-
Microsoft Windows 95
-
Microsoft Windows 98
-
Microsoft Windows NT 4.0
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
- xlUnicodeText
-and-
- 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.
RESOLUTION
A
Microsoft Excel 2000 Programmatic Text Export Update
that corrects this problem is available for download on the Office Update site:
http://officeupdate.com/2000/downloadDetails/xl9p2pkg.htm
MORE INFORMATION
Cells that contain custom formatting are not affected by this behavior.
For more information about how Microsoft products are affected by year 2000
(Y2K) issues, please see the following Microsoft World Wide Web site:
http://www.microsoft.com/year2000/
Additional query words:
XL2000 y2k
Keywords : kb2000 kbdtacode xlloadsave xlvbainfo
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb