Ask Your Question

gecos's profile - activity

2021-02-01 12:38:34 +0100 received badge  Famous Question (source)
2020-04-07 16:03:55 +0100 received badge  Famous Question (source)
2020-01-17 18:33:16 +0100 marked best answer LibreOffice Linux, xls vba code to call a so library

I am testing the Linux version of LibreOffice

Version: 6.0.7.3
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 test.so (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 "test.so" (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 "test.so" (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 test.so 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.

2020-01-17 17:48:15 +0100 edited question LibreOffice Linux, xls vba code to call a so library

LibreOffice Linux, xls vba code to call a so library I am testing the Linux version of LibreOffice Version: 6.0.7.3 Bui

2020-01-17 17:47:02 +0100 edited question LibreOffice Linux, xls vba code to call a so library

LibreOffice Linux, xls vba code to call a so library I am testing the Linux version of LibreOffice Version: 6.0.7.3 Bui

2020-01-17 17:43:43 +0100 edited question LibreOffice Linux, xls vba code to call a so library

LibreOffice Linux, xls vba code to call a so library I am testing the Linux version of LibreOffice Version: 6.0.7.3 Bui

2020-01-17 17:41:16 +0100 edited question LibreOffice Linux, xls vba code to call a so library

LibreOffice Linux, xls vba code to call a so library I am testing the Linux version of LibreOffice Version: 6.0.7.3 Bui

2020-01-16 20:24:04 +0100 commented question VBA, external C dll/so (shared library) not in memory

I can't comment about LibreOffice development, however considering the huge amount of xls/vba pages/applications created

2020-01-16 20:02:44 +0100 received badge  Notable Question (source)
2020-01-14 18:30:10 +0100 commented question VBA, external C dll/so (shared library) not in memory

thanks, I do not know if BASIC in LibreOffice includes methods to detect when a page or a equivalent action begins and e

2020-01-14 14:27:10 +0100 commented question VBA, external C dll/so (shared library) not in memory

actually i am converting a few xls pages (including VBA to access external library) , do you know if there is a way (wi

2020-01-14 14:24:13 +0100 commented question VBA, external C dll/so (shared library) not in memory

actually i am converting a few xls pages (including VBA to access external library) , do you know if there is a way (wi

2020-01-14 14:05:19 +0100 commented question VBA, external C dll/so (shared library) not in memory

Mike, does the intepreter, in present version, create an instance of shared library when running each macro ? According

2020-01-14 14:03:17 +0100 commented question VBA, external C dll/so (shared library) not in memory

Mike, does the intepreter, in present version, create an instance of shared library when running each macro ? According

2020-01-14 13:58:23 +0100 commented question VBA, external C dll/so (shared library) not in memory

Mike, does the intepreter, in present version, create an instance of shared library when running each macro ? According

2020-01-14 13:55:10 +0100 commented question VBA, external C dll/so (shared library) not in memory

Mike, does the intepreter, in present version, create an instance of shared library when running each macro ? According

2020-01-14 13:46:26 +0100 marked best answer Passing arrays in Basic, works with Excel , error 73 in LibreOffice

calling a (complex) method in external C dll (see below the header) the code works fine in Excel VBA (passing correctly all the arrays) while I get the error "BASIC runtime error. '73' Not implemented." from LibreOffice (in debugging phase, when calling mytest method), can you help with this error 73 ?
Should I adopt a different way to pass parameters ?

** C header (windows, test.dll) **

__declspec(dllexport) int WINAPI mytest(int,int,int,double*,double*,double*,double*,int,int,int,int*,int*,int,int*,int*,int*,double*,int,double*,int*,int*,int*,double*,double*);


** VBA in Excel 2016 **

Private Declare PtrSafe Function mytest Lib "test.dll" (ByVal csep As Long, ByVal stgnr As Long, ByVal init As Long, ByRef stgt As Double, ByRef stgp As Double, ByRef stgef As Double, ByRef stgdH As Double, ByVal prod_h As Long, ByVal btm_h As Long, ByVal fnr As Long, ByRef fstr As Long, ByRef fpos As Long, ByVal snr As Long, ByRef sstr As Long, ByRef spos As Long, ByRef sft As Long, ByRef sflow As Double, ByVal vnr As Long, ByRef vrv As Double, ByRef vtype As Long, ByRef stype As Long, ByRef siv As Long, ByRef srv As Double, ByRef flows As Double) As Long

Dim stgp(0 To 100) As Double  
Dim stgt(0 To 100) As Double
Dim stgef(0 To 100) As Double
Dim stgdH(0 To 100) As Double
Dim flows(0 To 2 * 100 * 100) As Double 
Dim sstr(0 To 2) As Long   
Dim spos(0 To 2) As Long
Dim sft(0 To 2) As Long
Dim sflow(0 To 2) As Double
Dim fstr(0 To 2) As Long    
Dim fpos(0 To 2) As Long
Dim vrv(0 To 1) As Double      
Dim vtype(0 To 1) As Long
Dim stype(0 To 1) As Long
Dim siv(0 To 1) As Long
Dim srv(0 To 1) As Double

    csep = 1 
    stgnr = 20
    init = 1 
    prod = 2 
    btm = 1 
    fnr =2
    snr = 2
    vnr = 2
    res = mytest(csep, stgnr, init, stgt(0), stgp(0), stgef(0), stgdH(0), prod, btm, fnr, fstr(0), fpos(0), snr, sstr(0), spos(0), sft(0), sflow(0), vnr, vrv(0), vtype(0), stype(0), siv(0), srv(0), flows(0))

** the same code converted to Libre Office **

(when executed, reports error : BASIC runtime error. '73' Not implemented.)

Private Declare Function mytest Lib "test.dll" (ByVal csep As Long, ByVal stgnr As Long, ByVal init As Long, stgt(), stgp(), stgef(), stgdH(), ByVal prod_h As Long, ByVal btm_h As Long, ByVal fnr As Long, fstr(), fpos(), ByVal snr As Long, sstr(), spos(), sft(), sflow(), ByVal vnr As Long, vrv(), vtype(), stype(), siv(), srv(), flows()) As Long

Dim stgp(0 To 100) As Double  
Dim stgt(0 To 100) As Double
Dim stgef(0 To 100) As Double
Dim stgdH(0 To 100) As Double
Dim flows(0 To 2 * 100 * 100) As Double 
Dim sstr(0 To 2) As Long   
Dim spos(0 To 2) As ...
(more)
2020-01-14 13:46:26 +0100 received badge  Scholar (source)
2020-01-14 13:07:51 +0100 received badge  Popular Question (source)
2020-01-14 12:57:53 +0100 edited question VBA, external C dll/so (shared library) not in memory

VBA, external C dll/so (shared library) not in memory I have a simple C dll (shared library, multi-threaded) which sto

2020-01-14 12:39:01 +0100 commented answer Passing arrays in Basic, works with Excel , error 73 in LibreOffice

yes, I am converting some xls pages (tested with Excel 2016, 2019) pages to LibreOffice, there is a C dll compiled for W

2020-01-14 12:22:02 +0100 edited question VBA, external C dll/so (shared library) not in memory

VBA, external C dll/so (shared library) not in memory I have a simple C dll (shared library) which stores (as static da

2020-01-14 12:17:43 +0100 edited answer Passing arrays in Basic, works with Excel , error 73 in LibreOffice

thanks for commenting my question, yes, LibreOffice Basic can work with arrays, the problem which i found is for that sp

2020-01-14 12:12:05 +0100 edited question Passing arrays in Basic, works with Excel , error 73 in LibreOffice

Passing arrays in Basic, works with Excel , error 73 in LibreOffice calling a method in external C dll (see below the he

2020-01-14 10:43:47 +0100 edited question VBA, external C dll/so (shared library) not in memory

VBA, external C dll/so (shared library) not in memory I have a simple C dll (shared library) which stores (as static da

2020-01-14 10:43:47 +0100 received badge  Editor (source)
2020-01-14 10:43:08 +0100 edited question VBA, external C dll/so (shared library) not in memory

VBA, external C dll/so (shared library) not in memory I have a simple C dll (shared library) which stores (as static da

2020-01-14 10:41:06 +0100 received badge  Notable Question (source)
2020-01-14 02:43:43 +0100 received badge  Popular Question (source)