>lnLastRow = oExcel.activesheet.UsedRange.Rows.Count >oExcel.activesheet.Range("A1:G"+TRIM(PADR(lnLastRow,11))).select >Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom >
#define xlAscending 1 #define xlGuess 0 #define xlTopToBottom 1 lnLastRow = oExcel.activesheet.UsedRange.Rows.Count oExcel.activesheet.Range("A1:G"+TRIM(PADR(lnLastRow,11))).select WITH oExcel.Selection .Sort("A1", xlAscending,,,,,, xlGuess, 1, .f., xlTopToBottom)