https://bugs.freedesktop.org/show_bug.cgi?id=67547

          Priority: medium
            Bug ID: 67547
          Assignee: [email protected]
           Summary: Can't access methods of ScriptProvider from VB
          Severity: normal
    Classification: Unclassified
                OS: Windows (All)
          Reporter: [email protected]
          Hardware: Other
            Status: UNCONFIRMED
           Version: 3.5.0 Beta0
         Component: framework
           Product: LibreOffice

Created attachment 83308
  --> https://bugs.freedesktop.org/attachment.cgi?id=83308&action=edit
Excel file containing VBA code to launch libreoffice and attempt to run a macro
in another document ( expected to be located at C: ) - will attach also

Can't invoke macros/scripts from VB. All attempts to access the 'getScript'
method of the document scriptprovider will fail. I've marked the earliest
release as 3.5 ( I'm pretty sure this goes back way further than that, earliest
LO I have here is 3.5 )

e.g.

Sub invokeLOMacro()

Dim sURL As String
sURL =
"vnd.sun.star.script:VBAProject.Module1.CalledFromImportedXLS?language=Basic&location=document"

Dim loServMgr As Object
Set loServMgr = CreateObject("com.sun.star.ServiceManager")

Dim oDesk As Object
Set oDesk = loServMgr.createInstance("com.sun.star.frame.Desktop")

Dim oDoc As Object
Dim args(1)

Set args(0) = MakePropertyValue("Hidden", False)
Set args(1) = MakePropertyValue("MacroExecutionMode", 4)  ' "4" is
com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN

Dim nullArray()
Set oDoc = oDesk.loadComponentFromURL("file:///c:/MacroXLS.xls", "_blank", 0,
args()) '

Dim scriptProv As Object
Set scriptProv = oDoc.getScriptProvider()

Dim xScript As Object
Set xScript = scriptProv.getScript(sURL) '<==== will fail here


The net result is it is not possible to invoke libreoffice basic, java, python
etc. scripts from VB ( using the scripting framework )

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

Reply via email to