Hallo
Your »oCurrentSheet« is actually the
…Sheets.getbyName("current")
but IMHO semantically it should:
thisComponent.CurrentController.ActiveSheet
the Value of right is actually a locale-dependent string like Spalte G (locale= german)
which needs additionally processing to become usefull !!… the same for bottom !!
So the semantically and better way is:
doc = ThisComponent
current_sheet = doc.CurrentController.ActiveSheet
cursor = current_sheet.createCursor()
cursor.gotoEndOfUsedArea(false )
'cell_name = cursor.AbsoluteName '→ eg. $Tabelle1.$G$8'
range_address = cursor.RangeAddress
index_lastrow = range_address.EndRow
index_lastColumn = range_address.EndColumn
but if you need simply the whole »used_Range_object«:
doc = ThisComponent
current_sheet = doc.CurrentController.ActiveSheet
cursor = current_sheet.createCursor()
cursor.gotoEndOfUsedArea( True ) 'use True'
'cursor is now the whole used Range'