>We have an old system which exports a set of records to an XLS spreadsheet. Because of the record limitation in COPY XLS we export the table in chunks of 60,000 records. Currently, this means three separate spreadsheets are exported.
>
>The user has requested that only one file be generated.
>
>I did a COPY TO CSV. But that runs into issues because some of the fields have embedded double-quote characters in the value. For example, a description field that is
>width = 5" and height = 5.5" and color = "red"
>and the double-quote is breaking the intended format of the result.
>
>I could probably write something that opens an instance of Excel and then writes cell by cell, but that has a different set of issues.
>
>I can also go through the table and CHRTRAN the double-quotes into a pair of double-quotes. That seems to clear the immediate issue.
>
>Is there some other "COPY" or "EXPORT" command that I can use to get the desired result? Or some completely different process?
>
>All advice welcome.
>
>............Rich
Best way to do is to directly insert into an excel sheet as data. I have poste many variations of a function which I named VFP2Excel, especially on foxite. Here is a link to one of those sample codes:
http://stackoverflow.com/questions/38562694/copy-to-excel-sheet-in-foxpro