How can I export data from Visual FoxPro into Excel file I know. I something like this:
USE tableName
EXPORT TO (fileName) TYPE XL5 AS CPDBF()
I get Excel file with one sheet. Does anybody know how can export second table to the same excel file but in different sheet? I prefer Visual FoxPro code but you can write me example in C#, for example how to export each data table to different Excel sheet but in the same Excel file.
Kind regards, Ozren Sirola
You can't do that with the EXPORT or COPY TO commands. To put data into multiple sheets in Excel, you need to use Automation. The fastest approach is probably to use EXPORT or COPY TO to create multiple workbooks, and then use Automation to consolidate the data into a single workbook.
The Automation part would look something like: