When Sheet1 is blank,nothing in it,the value of oCurs.RangeAddress.EndRow is 0, why the lastRow keeps 0 after writing data in calc table?
oDoc = ThisComponent
Sheet = oDoc.getSheets().getByName("Sheet1")
oCurs = Sheet.createCursor()
oCurs.gotoEndOfUsedArea(True)
lastRow = oCurs.RangeAddress.EndRow
print " when sheet is empty ,the row number is " & lastRow
Cell = Sheet.getCellByPosition(0,0)
Cell.value = 100
oCurs = Sheet.createCursor()
oCurs.gotoEndOfUsedArea(True)
lastRow = oCurs.RangeAddress.EndRow
print "after insert data in one line ,the row number is " & lastRow
I get the output
when sheet is empty ,the row number is 0
after insert data in one line ,the row number is 0
Why can’t get the below output?
when sheet is empty ,the row number is 0
after insert data in one line ,the row number is 1