I use GridExtras which is available on the SPS site and has CopyToExcel
in its GridExtrasProcs.prg
Not sure if you have the exact same version or file but this code works
for me:
CREATE CURSOR ctest (cName c(10))
INSERT INTO ctest VALUES ("gene")
INSERT INTO ctest VALUES ("frank")
SET PROCEDURE TO gridextrasprocs
m.lcFileName = "d:\temp\test.xlsx"
IF FILE(m.lcFileName)
ERASE (m.lcFileName)
ENDIF
IF copytoexcel(m.lcFileName, "Sheet1", "ctest", "Name", "cTest.cName")
MESSAGEBOX("Excel file created")
ELSE
MESSAGEBOX("Failed")
ENDIF
Frank.
Frank Cazabon
On 06/11/2019 08:44 PM, Gene Wirchenko wrote:
At 13:41 2019-11-06, Frank Cazabon <[email protected]> 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
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message:
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.