The following is my macro which I have attached to a push button control but it does not work. I have tried everything I can think of. Does anybody have any idea where I am going wrong.
Thanks,
OldJack
Sub Sort_Restore
Dim oSheet
Dim oRange
Dim oSortFields(0) as new com.sun.star.util.SortField
Dim oSortDesc(0) as new com.sun.star.beans.PropertyValue
oSheet = ThisComponent.Sheets(0)
oRange = oSheet.getCellRangeByName(“B10:M269”)
oSortFields(0).Field = 1
oSortFields(0).SortAscending = True
oSortDesc(0).Name = “SortFields”
oSortDesc(0).Value = oSortFields()
oRange.Sort(oSortDesc())
End Sub