Page 1 of 1

Invoke a function stored in an other document

PostPosted: Mon Sep 07, 2015 11:30 am
by klkmva
Hi guys,
from a public library module, i want to invoke a function stored in document. This code don't work :
Code: Select all   Expand viewCollapse view
' Sub stored in a public Library
Sub SelectX
Dim X
   ThisComponent.BasicLibraries.LoadLibrary("Standard")
   X = FunctionStoredInCurrentDoc()
End Sub

I don't find help on forums

Thank you

Re: Invoke a function stored in an other document

PostPosted: Mon Sep 07, 2015 1:04 pm
by Zizi64
If I know it exactly, it is not possible to call a function from an another document.

Functions are available from two places:
1.: from the library of the office suite ('myMacros - Standard Sibrary'),
2.: and from the Standard Library of the current document.

The Standard libraries will be loaded automatically into the memory when the application is launched or the document is loaded, other Libraries you must load by program code.

Re: Invoke a function stored in an other document

PostPosted: Tue Sep 08, 2015 6:42 pm
by hanya
Use the script provider to do it from the document instance that opened contains macros you want to invoke.

Re: Invoke a function stored in an other document

PostPosted: Tue Sep 08, 2015 10:17 pm
by Villeroy
Or start organizing your macros.