Caros, tenho as seguintes sub
sub OrdeDesc
Dim Doc As Object
Doc = ThisComponent
Dim oSheetDSC,oDSCRange As Object
Dim aSortFields(0) As New com.sun.star.util.SortField
Dim aSortDesc(0) As New com.sun.star.beans.PropertyValue
oSheetDSC = ThisComponent.Sheets.getByindex(0)
oDscRange = oSheetDSC.getCellRangeByName("a1:b15")
aSortFields(0).Field = 0
aSortFields(0).SortAscending = false
aSortDesc(0).Name = "SortFields"
aSortDesc(0).Value = aSortFields()
oDSCRange.Sort(aSortDesc())
End Sub
e
sub cursor
Dim Doc as object
Doc = ThisComponent
Dim Cur As Object ' cursor on the cell
Dim Range As Object ' the used range
Dim oSheet as object
Dim RowF, ColF,RowI, ColI as LONG
Dim RangeName as string
oSheet = ThisComponent.Sheets.getByIndex(0)
Cur = oSheet.createCursorByRange(oSheet.getCellRangeByName("A1"))
Cur.gotoEndOfUsedArea(True)
Range = oSheet.getCellRangeByName(Cur.AbsoluteName)
RowF = Range.RangeAddress.EndRow
ColF = Range.RangeAddress.EndColumn
RowI = Range.RangeAddress.StartRow
ColI = Range.RangeAddress.StartColumn
RangeName = Range.AbsoluteName
end sub
Individualmente funcionam. Mas não consigo (não sei se é possível) utilizar o resultado (“RangeName”) dessa segunda sub como input em
oDscRange = oSheetDSC.getCellRangeByName(“a1:b15”)
da primeira.
Alguém sabe se é possível e como fazê-lo?
obrigado