Macro gives me wrong row heights instead of the right ones

Hello !

The user of a Calc worksheet has the freedom of adjusting row heights manually. No big deal.
Now, in a macro, I want to know the value of some row heights the user has set.
I thought it will be easily solved but I ran into a problem.
The code below gives me the same row height, no matter which row I ask.

Sub TestRowHeight
dim oRow As Object, nHeight As Long
With ThisComponent.sheets("LabelTemplate")
    oRow = ThisComponent.sheets("LabelTemplate").getRows.getByIndex(0)
    nHeight = oRow.Height
    MsgBox "The Height of the first Row is " + nHeight
    oRow = ThisComponent.sheets("LabelTemplate").getRows.getByIndex(1)
    nHeight = oRow.Height
    MsgBox "The Height of the second Row is " + nHeight
End With
End Sub

I know for a fact that de height of the first row is different from the height of the second row, nevertheless, the message box always displays the height of the first row.

Am I missing something here?

Grtz,

Please excuse me for this question. I was still searching and found the answer.
Instead of

oRow = ThisComponent.sheets("LabelTemplate").getRows.getByIndex(0)

I should have used this:

oRow = ThisComponent.sheets.getByName("LabelTemplate").getRows.getByIndex(0)

Grtz,
:flushed:

Nothing to excuse. Finding your own errors is a good way to learn something. And sharing your own solution is welcome too…