macro to obtain row column like ctrl-end does

Asked by Phil Norisez

I need a macro in 12.04's LibreOffice Calc that will get the row and column of the last filled cell like ctrl-end does, but without moving the cursor. Any ideas?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Phil Norisez
Solved:
Last query:
Last reply:
Revision history for this message
Phil Norisez (norisezp) said :
#1

Solved:
  oSheets = ThisComponent.getSheets()
  oSheet = oSheets.getByName("Sheet1")
  oCurs = oSheet.createCursor()

  oCurs.gotoEndOfUsedArea(False)
  print oCurs.AbsoluteName
  print " Column Index = " & oCurs.RangeAddress.StartColumn & " Row Index = " & OCurs.RangeAddress.StartRow