Search code examples
excelsumexportvisual-foxprofoxpro

In Visual Foxpro how to export to excel with total


I'm looking to export a table from Visual Foxpro 5.0 to excel with a total for one column. I know you can calculate sum(column) but I don't know how to include this in the export.


Solution

  • I know you can calculate sum(column) but I don't know how to include this in the export

    The short answer is you cannot.

    You can use VFP's command: COPY TO excel file XL5 to output the DATA into the designated Excel file, but calculated values will not be included.

    BUT, after having written the data, you can then use VFP Automation of Excel to either write the calculated value into a specific cell or you can have Excel run the calculation for you and put the result into the specified cell.

    If you haven't done VFP Automation of Excel you might want to Google for that since it involves a number of commands which need to vary based on your specific needs.

    Good Luck