FoxUser7


I'm using the following statements for reading from a multiple-sheet Excel file:

CREATE CURSOR Main (ID N(3,0), SUBID N(3,0), DESC C(60), D C(128), E C(10), F C(10), G C(10), H C(10), I C(10), J C(10), K C(10), L C(10), M C(10), N C(10), O C(10), P C(10), Q C(10) )

APPEND FROM (cFile) TYPE XL5 SHEET "cSheet_n"

with cSheet_n = sheet names of the current spreadsheet.

The tables had been saved as Excel5.0 workbooks.

Typically 100 rows are being read per sheet, typically 5 to 10 sheet per file in total.

If the table is somewhat larger or contains more commenting text within the columns E (from which I read 10 chars only), the procedure tends to crash, but astonishingly this isn'z really reproducible (sometimes on the 1st sheet, sometimes on the 4th only)!

I tried out with XL8 instead of XL5 -> no difference.

If I replaced all formula in the sheet by the values, it behaved better, but not clearly stable (still crashing sometimes).

What's wrong




Re: VFP7 crashes with "Fatal error: Exception code=C0000005" during data import from Excel


Re: VFP7 crashes with "Fatal error: Exception code=C0000005" during data import from Excel

Craig Berntson

C5 errors are almost impossible to track down. However, one thing you can try... delete all instances of FoxUser.*.







Re: VFP7 crashes with "Fatal error: Exception code=C0000005" during data import from Excel

Carl Warner

I always start with deleting the Fox resource files when I occasionally get a C5 error. (foxuser.*) If that doesn't solve it, read on.

Obviously, you feel you must use a CURSOR.

Just for testing purposes to rule in or out the use of a table, try doing the same task, except create a temporary free table instead of the cursor and see whether that makes a difference. Sometimes a workaround, especially in older versions of VFP, is the only way to go.


CREATE TABLE (SYS(2023)+"\Main") FREE .....