Export to Excel - sort the results in Excel

cbrandon63

New Member
First time I've posted here .. great site.

I've created a Progress application that exports results to Excel. I've got an include file that formats the fields and can manage multiple sheets.

Does anyone have a function that will sort the data in Excel?
 
Got this to work:
DEF VAR vNamedRange AS CHAR NO-UNDO . /* M2 */
DEF VAR vPgTitle AS CHAR NO-UNDO.
DEF VAR vSubTitle AS CHAR NO-UNDO.
DEF VAR vProgDesc AS CHAR NO-UNDO INIT "All".
&GLOBAL-DEFINE xlGuess 0
&GLOBAL-DEFINE xlAscending 1
&GLOBAL-DEFINE xlSortValues 0
&GLOBAL-DEFINE xlSortRows 1
&GLOBAL-DEFINE xlPinYin 1

FUNCTION ssSort RETURNS LOG (INPUT pSCol AS CHAR, pSRow AS INT, pECol AS CHAR, pERow AS INT, pArea AS CHAR, pType AS CHAR, pFormat AS CHAR):
vNamedRange = "A7:N" + STRING(pERow).
{&WorkSheet}:Range(vNamedRange):Sort( {&WorkSheet}:Range("E7:E" + STRING(pERow) ), {&xlAscending}, , , , , , {&xlGuess}, , false, {&xlSortRows}, {&xlPinYin}, , , ).
RETURN TRUE.
END FUNCTION. /* ssSort*/
 
Back
Top