Microsoft KB Archive/141355

= FIX: Copy/Paste Causes GP Fault w/Worksheet Created by COPY TO =

Article ID: 141355

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q141355



SYMPTOMS
A general protection (GP) fault may occur when you try to paste a range of cells copied from a worksheet that you originally created from a table in Visual FoxPro. The error states:

This program has performed an illegal operation and will be shut down. If the problem persists, contact the program vendor.

The details state:

EXCEL caused an invalid page fault in module EXCEL.EXE at 01737:5014a2f8.



CAUSE
This error occurs when the following conditions exist:


 * You created a Microsoft Excel version 5.0 .xls file.
 * You are using Microsoft Excel version 7.0 to edit the file.



WORKAROUND
There are two workarounds for this problem.

Method 1
To create the .xls file in Visual FoxPro, use the COPY TO command in the following form: COPY TO filename TYPE XLS rather than: COPY TO filename TYPE XL5

Method 2
After using the COPY TO command with the TYPE XL5 clause to create a Microsoft Excel worksheet, use only Microsoft Excel version 5.0 to open the resulting worksheet.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.



MORE INFORMATION
Microsoft Excel version 7.0 for Windows was not available when Visual FoxPro for Windows was released.

Steps to Reproduce Problem
 Open or switch to Microsoft Visual FoxPro. Open (with the USE command) the Customer table from \Vfp\Samples\Data.  In the Command window, enter the following line of code: COPY TO C:\TEST.XLS TYPE XL5  Start Microsoft Excel version 7. Then locate and open Test.xls. Select some range of cells (can be one).</li> On the Edit menu, click Copy. Then on the File menu, click New.</li> Click the General tab, select Workbook, and click OK.</li> On the Edit menu, click Paste. At this point, the error occurs.</li></ol>

Keywords: kbbug kbfix kbvfp500fix KB141355

-

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

© Microsoft Corporation. All rights reserved.