Alguien sabe como se tendría que hacer este Macro en Fivewin, para hacer un sort en una hoja Excel:
- Code: Select all Expand view RUN
Selection.Sort Key1:=Range("A9"), Order1:=xlAscending, Key2:=Range("R9") _
, Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
He encontrado, que la funcion Sort, es miembro de Excel.range, definida de esta forma
- Code: Select all Expand view RUN
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])
y he tratado de utilizarla de esta manera:
- Code: Select all Expand view RUN
#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)
Pero obtengo el mensaje:
- Code: Select all Expand view RUN
Error DIS_E_BADPARAMCOUNT:RANGE
Alguien ha podido hacer un sort en una hoja Excel desde Fivewin?
Gracias.
Carlos Sincuir