API reference for ThisComponent in libreoffice calc Basic macros?

I see, but the listed variables didn’t show any properties? I’ve tried a sample script (shows contents of selected cells):

Sub Main
Set oRange = ThisComponent.CurrentSelection
    For i = 0 To oRange.Rows.getCount() - 1             
        For j = 0 To oRange.Columns.getCount() - 1
            Set oCell = oRange.getCellByPosition( j, i )
            Print oCell.String
        Next
    Next 
End Sub

but that’s all it showed (there were no context menus or options available to expand them):
image

Oh yes, they would show anything only when the code runs. Put a breakpoint (even at the very start of a function), and run it.

1 Like

ooooh now it makes sense :slight_smile:

Thank you very much, that changes the game completely :clap:

This reminds me of IDE from Rhino, a lot, it worked similarly (I’m sure a lot of built-in code editors are like that as well). Sorry, I could have thought about this sooner :person_facepalming:

ThisComponent isn’t an API service or interface, but a predefined Basic variable.
What services it supports depends fundamentally on the case.

Please don’t try to get your single-student-programmimg-class here.

Sorry, I didn’t mean to spam the forum, but after a day of searching I was still stuck - the above recommendation to use the “Watch” panel is an absolute game changer and it allows you to investigate the object model much more independently, so it shouldn’t happen again.