Ask Your Question

Globalscope.BasicLibraries.LoadLibrary(<lib name>) etc. not working

asked 2017-02-24 06:51:16 +0200

owlbrudder gravatar image

I am working through examples from Andrew Pitonyak's 'AndrewPersonalLibs.odt' and have hit a problem.

In library AndrewTestLib, module Module1 is a macro CopyLibToDoc. In this is a couple of lines of code designed to load a library which I have edited to 'AndrewBase':

sLName = "AndrewBase"
If (Not Globalscope.BasicLibraries.isLibraryLoaded(sLName)) Then
End If

The trouble is, this does not work for some reason. image description

As you can see from the MRI window, the only accessible libraries are from 'My Macros & Dialogs' and 'LibreOffice Macros & Dialogs'. Any attempt to load any of the other libraries through code gives the same result: the library cannot be found, cannot be loaded etc.

Is there something I am missing?

Thanks, Doug

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-02-24 07:16:18 +0200

You may find this useful:

GlobalScope doesn't relate to open documents' libraries. If you use a library from current document, you need to use BasicLibraries instead of Globalscope.BasicLibraries.

edit flag offensive delete link more


Thanks Mike - that solved it. Why does the "Elements" list of oDocLibCont and oLibCont not list the library I have just loaded:

oDocLibCont = createUnoService("") subInspect(oDocLibCont) oLibCont = createUnoService("") subInspect(oLibCont)

Also, can I load the library of Document A from Document B?

owlbrudder gravatar imageowlbrudder ( 2017-02-24 21:50:25 +0200 )edit

As for second question - oDoc.BasicLibraries works for any opened oDoc.



Mike Kaganski gravatar imageMike Kaganski ( 2017-02-24 23:12:13 +0200 )edit

Excellent. Thanks Mike - I now have some more research to do - just love learning new stuff. "8-)

owlbrudder gravatar imageowlbrudder ( 2017-02-25 08:44:24 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-02-24 06:51:16 +0200

Seen: 359 times

Last updated: Feb 24 '17