XL5: FoxPro Dates Exported to Microsoft Excel as Text

Last reviewed: September 12, 1996
Article ID: Q123197
The information in this article applies to:
  • Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0, 5.0c
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6, 2.6a
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6, 2.6a

SYMPTOMS

When you export a FoxPro database containing a DATE field to Microsoft Excel by using the Copy To dialog box, the dates are formatted as text when you open the file in Microsoft Excel.

CAUSE

This behavior is by design of Microsoft FoxPro. When you use the Copy To feature in Microsoft FoxPro to copy your data to a Microsoft Excel file, the data in the .DBF file is exported as unformatted text strings.

WORKAROUNDS

To correct this problem, do the following in Microsoft Excel 5.0:

NOTE: These steps assume that cell A2 contains the date and that cells B2 and C2 are empty.

  1. In cell B2, type "=DATEVALUE(A2)" (without the quotation marks), and then press ENTER.

  2. Select cell B2 again. From the Edit menu, choose Copy.

  3. Select cell C2. From the Edit menu, choose Paste Special.

  4. In the Paste Special dialog box, under Paste, select the Values option, and then choose OK.

You can now use the Format Cells dialog box to format the date value with the desired date format.

To avoid this behavior, export the Microsoft FoxPro data using the Table (DBF) file format instead of the Microsoft Excel format.

For additional information, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q101288
   TITLE     : PRB: FoxPro Dates Exported to Microsoft Excel as Characters


REFERENCES

For more information about Tips For Importing, Exporting, And Sharing Data, choose the Search button in Help and type:

   importing data from other applications, tips on


KBCategory: kbinterop
KBSubcategory:

Additional reference words: 2.00 2.50 2.50a 2.50b 2.60 2.60a 2.x
2.50x 4.00 4.00a 5.00 5.00c Export date spread sheet tshoot



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.