What parameters did you pass in?
The syntax is:
CopyToExcel("C:\Test.xlsx", "Sheet1", "MyTable")
This is the header of the Function in the GridExtrasProcs.prg that I have and use:
FUNCTION CopyToExcel(tcXLSFile, tcSheet, tvWorkArea, tcExcelFieldList, tcTableFieldList, tcTableForExpr) *********************************** * PARAMETER Information * tcXLSFile := a string specifying an excel file (*.xls, *.xlsx, *.xlsm, *.xlsb) on disk * tcSheet := a string specifying the name of the worksheet to create within the excel workbook * tvWorkarea [optional] := the Alias, Work Area, or File Name of the table you want to be copied to the worksheet (default is currently selected Alias) * tcExcelFieldList [optional] := a comma delimited list of columns you want to create in the worksheet (default is '*' - columns will match table field list) * tcTableFieldList [optional] := a comma delimited list of fields you want this function to copy from tvWorkArea * tcTableForExpr [optional] := a valid VFP Where/For clause to be used when querying tvWorkArea for data to be copied to the worksheet * * RETURN Information * returns numeric, the number of records inserted into the worksheet * * Provider Information * the default provider being used in the SQLStringConnect function can be downloaded and installed from: * http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-...
Frank.
Frank Cazabon
On 06/11/2019 03:35 PM, Gene Wirchenko wrote:
At 06:08 2019-10-30, "Tracy Pearson" tracy@powerchurch.com wrote:
Gene,
I have not seen a difference in the output of the two commands.
You might want to consider looking at Craig Boyd's post about exporting and importing from Excel. It doesn't mention Memo fields that I could see. https://www.sweetpotatosoftware.com/blog/index.php/2008/09/30/using-excel-20
07-file-formats-in-vfp-9-0/
Have you tried it? All I got for results with CopyToExcel() was an empty spreadsheet. No column headers, no rows.
[snip]
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]
At 13:41 2019-11-06, Frank Cazabon frank.cazabon@gmail.com wrote:
What parameters did you pass in? The syntax is: CopyToExcel("C:\Test.xlsx", "Sheet1", "MyTable") This is the header of the Function in the GridExtrasProcs.prg that I have and use: FUNCTION CopyToExcel(tcXLSFile, tcSheet, tvWorkArea, tcExcelFieldList, tcTableFieldList, tcTableForExpr)
Yup. I specified the spreadsheet (tried no directory and with directory), a sheet name (both "export" and "Sheet1"), and both a filename and an alias.
All I get is an empty spreadsheet, and the return value is 0 every time. No error messages either.
[snip]
Sincerely,
Gene Wirchenko