I would like to use the sort method of a range from a python script.
This works well from oobasic but with python the sort command seems to be ignored. No error is thrown.
Here is the sample code I am using:
doc = XSCRIPTCONTEXT.getDocument()
oSheet = doc.CurrentController.ActiveSheet
selection = doc.CurrentSelection
sortfield = uno.createUnoStruct(“com.sun.star.table.TableSortField”)
sortfield.Field = 0
sortfield.IsAscending = True
sortfield.IsCaseSensitive = False
odesc = selection.createSortDescriptor()
odesc.Value = sortfield