https://bugs.documentfoundation.org/show_bug.cgi?id=117739

            Bug ID: 117739
           Summary: Malfunction in com.sun.star.bridge.OleObjectFactory
           Product: LibreOffice
           Version: 5.1.6.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I cannot access the contents of a variable created by executing a VBScript via
the'automation bridge'. The error message (in line "rueck = WSH.CodeObject.x")
is (german LO):

"BASIC-Laufzeitfehler.
 Es ist eine Ausnahme aufgetreten 
 Type: com.sun.star.uno.RuntimeException
Message: [automation bridge] Could not get FUNCDESC for x."

My code is:

Sub WSH_test()
        'kopiert Adressen aus Kontakte-Ordner von Outlook in eine Tabellendatei
        'und meldet diese Tabellendatei als Datenbank namen "Outlook_Kontakte"
in OO an

        Dim OleService As Object
        Dim WSH As Object
        Dim vbs
        Dim i, j

        Dim rueck

        If getGuiType() <> 1 Then
                Msgbox "Dieses Makro funktioniert nur unter dem Betriebssystem
MS Windows.", 16, "Abbruch"
                Exit Sub
        End If

        OleService = CreateUnoService("com.sun.star.bridge.OleObjectFactory")
        WSH = OleService.CreateInstance("MSScriptControl.ScriptControl")
        WSH.Language = "VBScript"

        vbs = vbs & "x = Array(1,2,3)" + CHR(10)
        vbs = vbs & "Msgbox 3+4" 

        WSH.ExecuteStatement(vbs)

        rueck = WSH.CodeObject.x

        For i = 0 To UBOUND(rueck)
                j = j & rueck(i) & CHR(13)
        Next i

        Msgbox j

End Sub


Notice:
The code works fine in AOO (tested in AOO 4.1.2)

Steps to Reproduce:
run the code:

Sub WSH_test()
        'kopiert Adressen aus Kontakte-Ordner von Outlook in eine Tabellendatei
        'und meldet diese Tabellendatei als Datenbank namen "Outlook_Kontakte"
in OO an

        Dim OleService As Object
        Dim WSH As Object
        Dim vbs
        Dim i, j

        Dim rueck

        If getGuiType() <> 1 Then
                Msgbox "Dieses Makro funktioniert nur unter dem Betriebssystem
MS Windows.", 16, "Abbruch"
                Exit Sub
        End If

        OleService = CreateUnoService("com.sun.star.bridge.OleObjectFactory")
        WSH = OleService.CreateInstance("MSScriptControl.ScriptControl")
        WSH.Language = "VBScript"

        vbs = vbs & "x = Array(1,2,3)" + CHR(10)
        vbs = vbs & "Msgbox 3+4" 

        WSH.ExecuteStatement(vbs)

        rueck = WSH.CodeObject.x

        For i = 0 To UBOUND(rueck)
                j = j & rueck(i) & CHR(13)
        Next i

        Msgbox j

End Sub

Actual Results:  
I get an error message

Expected Results:
the content of variable x is returned


Reproducible: Always


User Profile Reset: Yes



Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to