>I´m trying to export a file to excell, but only 16383 records are in the output file.
>there are about 40000 records in total that should be exported
It's limitation of COPY TO...TYPE XL? command in VFP7 and earlier. In VFP8 you can export a maximum of 65,535 rows, which is Excel 97 and later limit.
--sb--