Created attachment 146419 [details]
Bug demo: spreadsheet to call user defined function ADDUP, function in Module1
User defined functions return one of their calling arguments rather than their result when VBA support is enabled by declaring;
Option VBASupport 1
at the start of the module.
I note a warning that imported VBA code may not reliably access LibreOffice objects at https://help.libreoffice.org/latest/he/text/sbasic/shared/03103350.html
However, this is native code and it does not access objects.
Here is the spreadsheet (also see attached file:
The user defined ADDUP function was created and stored in the spreadsheet’s own module, as usual i.e. there should be no issue with the spreadsheet not being able to see the code.
The function adds 2 numbers.
Function Addup(VarA as Single, VarB as Single) as Single
Addup = VarA + VarB
The result without VBA support is as expected:
VBA support is enabled by adding the following at the start of the module:
Option VBASupport 1
The result with VBA support enabled is that a calling argument is returned, not the function result:
i cannot reproduce with:
Version: 22.214.171.124.alpha1+ (x64)
Build ID: 15aee54bb56982d57c27234a4ae946b45354c310
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win;
Locale: de-DE (de_DE); Calc: threaded
Version: 126.96.36.199 (x64)
Build ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: de-DE (de_DE); Calc:
result is always 6.
I can't reproduce it in
ID de la construcció: 1:6.1.3~rc2-0ubuntu0.16.04.1
Fils de CPU: 4; SO: Linux 4.15; Renderitzador de la IU: per defecte; VCL: gtk3;
Configuració local: en-US (ca_ES.UTF-8); Calc: group threaded
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Thanks to Oliver & Xisco for responding.
Issue still present on latest stable version
Build ID: 1:6.1.3~rc2-0ubuntu0.18.04.2
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: en-AU (en_AU.UTF-8); Calc: group threaded
Note that the failure to reproduce on 188.8.131.52 by Xisco Faulí was on Ubuntu 16.0.4, not 18.0.4. Maybe there is something being called from the OS that's causing the problem? I am not a developer, so do not have skills to dig into this possibility.
Did not want to risk installing 6.2, a pre-release version. Also note that the test by Oliver Brinzing was on a Windows OS not Ubuntu.
(In reply to David M from comment #3)
> Did not want to risk installing 6.2, a pre-release version. Also note that
> the test by Oliver Brinzing was on a Windows OS not Ubuntu.
A convenient way to test without installing is to use an appimage: https://libreoffice.soluzioniopen.com/
Bug found to be fixed when testing a later version of LibreOffice.
Build ID: 1:6.2.5-0ubuntu0.18.04.1~lo1
Thanks to all for comments.