Property of ThisComponent does not appear with impress macro when Running on Raspberry Pi

I am using libre office on 3.6, on a raspberry pi. I have installed libre office with no problems. On past versions i would use a macro to stop the powerpoint presentation from pausing at the end of a slideshow, using this article That worked flawlessly for a little while, until i built a new device, and now when i try and apply this macro i get the following error “BASIC runtime error. Property or method not found: Presentation” on line 12, “Presentation = Doc.Presentation”. Unfortunately i dont know scripting well enough to know what is going on. Does anyone have any idea for me to look at?

REM  *****  BASIC  *****
REM Set presentation variables for all presentations
REM See also the OOo Developer's Guide:

Sub Main

Dim Doc As Object
Dim Presentation As Object

Doc = ThisComponent
Presentation = Doc.Presentation

REM Uncomment the line below to make all presentations loop endlessly:
REM Presentation.IsEndless(True)

The error is that the object Doc is being reported as not having the property Presentation. When properly created, the object of course does have that property. You can see via this command: MsgBox Doc.dbg_properties. In a long list in the pop-up box, you will see the SbxOBJECT Presentation which means the property Presentation returns an object which also has properties and methods itself (such as IsEndless).

So why is/was this problem happening? Based on your question, and my own experience, I would guess that your macro is getting ahead in timing of the operation of LibreOffice, and so it is retrieving this variable before it is defined globally or before it has the expected properties and methods. If you do the command noted above, it may report something like ‘Introspection Not Available’. The way to deal with this kind of problem is to test for the availability of the property and Wait 10. You could just Wait an arbitrary length of time (like Wait 3000) or you could institute a loop test:

Do Until InStr(ThisComponent.dbg_properties, "Presentation") > 0
  Wait 10

When the property appears, it will proceed. As a backup, might want to build a counter into that to make sure it stops eventually if the property never appears.

try to attach to event:
→Tools→Customize→Events→Document loading finished instead …Open Document