Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Date field data is incorrect if you use Open or OpenText to open a .csv file in Excel 2000


View products that this article applies to.

This article was previously published under Q281125
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 (http://support.microsoft.com/kb/256986/EN-US/ ) Description of the Microsoft Windows Registry

↑ Back to the top


Symptoms

If you use the Open method or the OpenText method to open a Comma Separated Value (.csv) file in Microsoft Excel 2000 through a Microsoft Visual Basic for Applications macro, the dates appear incorrect.

↑ Back to the top


Cause

This behavior occurs if the .csv file contains a date that is formatted in any other format than the Standard English (United States) format of M/d/yyyy.

Note This behavior will also occur if you change your system date setting to match the date format in the file that you are opening.

↑ Back to the top


Resolution

Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To resolve this behavior, follow these steps:
  1. Close any programs that are running.
  2. On the Start menu, click Run, type regedit, and then click OK.
  3. In Registry Editor, expand the following key:
    HKey_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Options
  4. On the Edit menu, point to New, and then click DWORD Value. With New Value #1 selected, type VBAAlwaysLoadUS, and then press ENTER.

↑ Back to the top


More information

By design, the behavior in Microsoft Excel 2000 is different from past versions of Excel. The change in how the OpenText method translates dates was completed to align Excel 2000 with International date standards. By default, this date translation behavior occurs because Excel always uses the M/d/yyyy format when you use the OpenText method in Visual Basic for Applications. Considering this fact, Excel interprets imported dates according to this standard.

Note If you open the .csv file manually, Excel will not use the default M/d/yyyy. Instead, it will use the language date format that is set for the operating system environment.

↑ Back to the top


References

For more information about using the OpenText method, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type OpenText in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Search for Open in Microsoft Visual Basic Help for more information about the Open method.

↑ Back to the top


Keywords: KB281125, kbpending, kbprb, kbchart, kbtshoot

↑ Back to the top

Article Info
Article ID : 281125
Revision : 1
Created on : 12/3/2004
Published on : 12/3/2004
Exists online : False
Views : 206