Invoke a function stored in an other document

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
klkmva
Posts: 2
Joined: Wed Mar 25, 2015 3:30 pm

Invoke a function stored in an other document

Post 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

' 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
klkmva
LibreOffice 5.4.6.2
Windows 7
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Invoke a function stored in an other document

Post 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.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Invoke a function stored in an other document

Post by hanya »

Use the script provider to do it from the document instance that opened contains macros you want to invoke.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Invoke a function stored in an other document

Post by Villeroy »

Or start organizing your macros.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply