Property or method not found: getEmbeddedObjects.

I am trying to run the code below on a presentation containing equations, but I get the following error:

BASIC runtime error.
Property or method not found: getEmbeddedObjects.

I don’t know why it is not being found - any ideas? Thanks.

REM  *****  BASIC  *****
Sub ReformatFormulas
    embeddedObjects = ThisComponent.getEmbeddedObjects()
    elementNames = embeddedObjects.getElementNames()
    for i=0 to UBOUND(elementNames)
        element = embeddedObjects.getByName(elementNames(i)).Model
        oXEO = embeddedObjects.getByName(elementNames(i)).ExtendedControlOverEmbeddedObject
        iCurrentState = oXEO.currentState
        if (not isNull(element)) then
            if (element.supportsService("")) then
                element.BaseFontHeight = 10
                element.FontNameVariables= "Times New Roman"
                element.FontNameFunctions = "Times New Roman"     
                element.FontNameNumbers= "Times New Roman"        
                element.FontNameText= "Times New Roman"       
    next i
End Sub

Edited for clarity. Please use preformatted text icon on toolbar for this.