Microsoft KB Archive/177339

= PRB: OLE Error When Appending from Excel 97 Workbook =

Article ID: 177339

Article Last Modified on 5/12/2003

-

APPLIES TO

 Microsoft Visual FoxPro 3.0b Standard Edition, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 95  Microsoft Visual FoxPro 5.0 Standard Edition, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 95</li></ul> </li> Microsoft Visual FoxPro 5.0a, when used with:  Microsoft Windows NT 4.0</li></ul>

 Microsoft Windows 95</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q177339

<div class="symptoms_section">

SYMPTOMS
When you use the APPEND FROM TYPE XL5 to import an Excel 97 workbook into a FoxPro table, one of two OLE error messages appear:

Visual FoxPro versions 3.0x and 5.0x running on Windows 95 produces the following error:

OLE error code

0X800300002:%1

could not be found

Running on Windows NT 4.0 produces the following error:

OLE error code

0X800300002:

unknown OLE status code

<div class="cause_section">

CAUSE
The APPEND FROM command in Visual FoxPro versions 3.0x and 5.0x does not support Excel 97 workbook files.

<div class="resolution_section">

RESOLUTION
Here are two resolutions:


 * Save the Excel workbook in Excel as a Microsoft Excel 5.0/95 workbook and use the APPEND FROM command with the TYPE XL5 clause.

-or-
 * Save the file as a Microsoft Excel 4.0, 3.0 or 2.1 worksheet and use the TYPE XLS clause.

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

MORE INFORMATION
Since both error messages are OLE errors and most developers do not consider APPEND FROM to be an OLE command, it is not apparent that the Excel file type is causing the error to occur.

Steps to Reproduce Behavior
<ol> Start Microsoft Excel 97 and create a new workbook.</li> In cells A1 through C1, type the following data:

Some test data

</li> Save the file to your Visual FoxPro home folder with the name Ztest.xls as a Microsoft Excel Workbook (*.xls) and then close Excel.</li>  Start Visual FoxPro and type the following command in the FoxPro Command window to create a test table: CREATE TABLE ztest (first c(10), second c(10), third c(10)) </li>  In the FoxPro Command window, type the following command to import data from the Excel workbook: APPEND FROM Ztest.xls TYPE XL5 The error that appears depends on the operating system on the machine. </li></ol>

Additional query words: Excel APPEND FROM OLE

Keywords: kbinterop kbprb KB177339

-

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

© Microsoft Corporation. All rights reserved.