Knowledge Base

FIX: A Microsoft Excel worksheet that contains formulas does not correctly import in Visual FoxPro for Windows 3.0

Article ID: 137949

Article Last Modified on 3/17/2005


APPLIES TO


This article was previously published under Q137949

SYMPTOMS

If a Microsoft Excel spreadsheet's cells contain formulas, the Import function in Visual FoxPro will not import the data correctly. All or part of the data may be invalid when it is imported to the .dbf file.

RESOLUTION

There are two ways to work around this problem. Both correctly resolve the cells containing formulas. However, the first is the easiest and recommended method to use.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0b for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. In Microsoft Excel, create a new worksheet with the following values in the respective cells:
       Cell   Content
       --------------
       A1     Field1
       B1     Field2
       A2     25
       B2     =A2 * 3
    						
    NOTE: Cell B2 displays the number 75 when you move off of it by pressing the TAB key.
  2. Save the worksheet as xl2dbf.
  3. Close the worksheet.
  4. Switch to Visual FoxPro, and on the File menu, click Import.
  5. In the Import dialog box, select .xls as the Type and xl2dbf.xls saved in step 2 as the specific worksheet to import.
  6. Click OK. An xl2dbf.dbf file will be created.
  7. Browse the imported table, and note that the value in Field2 will be a random date, or other invalid value, rather than the correct value of 75.

Additional query words: VFoxWin fixlist3.00b buglist3.00 missing incorrect blank zero xcel

Keywords: kbbug kbfix KB137949