Alguien sabe como se tendría que hacer este Macro en Fivewin, para hacer un sort en una hoja Excel:
Code: Select all
Selection.Sort Key1:=Range("A9"), Order1:=xlAscending, Key2:=Range("R9") _
, Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Code: Select all
Function Sort([Key1], [Order1 As XlSortOrder = xlAscending], [Key2], [Type], [Order2 As XlSortOrder = xlAscending], [Key3], [Order3 As XlSortOrder = xlAscending], [Header As XlYesNoGuess = xlNo], [OrderCustom], [MatchCase], [Orientation As XlSortOrientation = xlSortRows], [SortMethod As XlSortMethod = xlPinYin], [DataOption1 As XlSortDataOption = xlSortNormal], [DataOption2 As XlSortDataOption = xlSortNormal], [DataOption3 As XlSortDataOption = xlSortNormal])
Code: Select all
#define xlAscending 1
#define xlDescending 2
#define xlGuess 0
#define xlTopToBottom 1
#define xlSortNormal 0
...
oRan1 := oSheet:Range("A9")
oRan2 := oSheet:Range("R9")
oExcel:Range:Selection:Sort( oRan1, xlAscending, oRan2, xlDescending,,,xlGuess,1,.f.,xlTopToBottom,,xlSortNormal,xlSortNormal)
Code: Select all
Error DIS_E_BADPARAMCOUNT:RANGE
Gracias.
Carlos Sincuir