Ask Your Question

LibreOffice Linux, xls vba code to call a so library

asked 2020-01-17 17:36:44 +0100

gecos gravatar image

updated 2020-01-17 17:48:15 +0100

I am testing the Linux version of LibreOffice

Build ID: 1:6.0.7-0ubuntu0.18.04.10
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: x11; 
Locale: en-US (en_US.UTF-8); Calc: group

for tests I created a simple xls page with one macro (Sub mysub) to call a shared library (64 bit, compiled with CLang and tested with Python), I have tested several modifications (meaning changing the "Private Declare Function mytest...") of the code working with the Windows version

Private Declare Function mytest Lib "" (ByVal p As Long) As Long

Sub mysub
Dim i As Long
i = mytest(5)
end Sub

however (in all my tests) when debugging (step by step) some variant of the code

Private Declare Function mytest Lib "" (ByVal p As Long) As Long

Libreoffice reports

BASIC runtime error. '73' Not implemented.

my questions :

1) does the LibreOffice Linux Basic allow to access my library ?
2) if yes, which is the correct way to code this macro so that LibreOffice interpreter calls dlopen() or a equivalent system method ?

I understand that this request may appear basic but still I was unable to find a working example for Linux version of LibreOffice...

thanks for help.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-01-17 18:15:11 +0100

erAck gravatar image

Calling arbitrary shared objects' functions from Basic is, well, not implemented..

You could however call a Python script from Basic, or omit Basic altogether and use Python right on, and Python in turn could handle the shared object call. See and

edit flag offensive delete link more


thanks for help, before to start testing with LibreOffice BASIC (creating a xls page with some code) I have tested the library from Python and it works fine, unfortunatelly Python requires additional settings and I did hope that a simple solution (as that for LibreOffice windows) was available, from your comments it appears that the BASIC intepreter in Linux version doesn't allow to call shared libraries and I must look for alternatives...

gecos gravatar imagegecos ( 2020-01-17 18:32:49 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-01-17 17:36:44 +0100

Seen: 131 times

Last updated: Jan 17 '20