Discussion:
[Libreoffice-bugs] [Bug 121262] New: User defined function returns argument not result with VBA support enabled
b***@bugs.documentfoundation.org
2018-11-08 01:28:55 UTC
Permalink
https://bugs.documentfoundation.org/show_bug.cgi?id=121262

Bug ID: 121262
Summary: User defined function returns argument not result with
VBA support enabled
Product: LibreOffice
Version: 6.0.6.2 release
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: libreoffice-***@lists.freedesktop.org
Reporter: ***@posteo.net

Created attachment 146419
--> https://bugs.documentfoundation.org/attachment.cgi?id=146419&action=edit
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:

VarA 4
VarB 2
ADDUP =ADDUP(B3,B4)

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
End Function

The result without VBA support is as expected:

VarA 4
VarB 2
ADDUP 6

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:

VarA 4
VarB 2
ADDUP 4
--
You are receiving this mail because:
You are the assignee for the bug.
b***@bugs.documentfoundation.org
2018-11-08 18:25:15 UTC
Permalink
https://bugs.documentfoundation.org/show_bug.cgi?id=121262

Oliver Brinzing <***@gmx.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmx.de

--- Comment #1 from Oliver Brinzing <***@gmx.de> ---
i cannot reproduce with:

Version: 6.2.0.0.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: 6.1.3.2 (x64)
Build ID: 86daf60bf00efa86ad547e59e09d6bb77c699acb
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: de-DE (de_DE); Calc:

result is always 6.

Linux only?
--
You are receiving this mail because:
You are the assignee for the bug.
b***@bugs.documentfoundation.org
2018-12-10 17:02:04 UTC
Permalink
https://bugs.documentfoundation.org/show_bug.cgi?id=121262

Xisco Faulí <***@libreoffice.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@libreoffice.org
Ever confirmed|0 |1
Status|UNCONFIRMED |NEEDINFO

--- Comment #2 from Xisco Faulí <***@libreoffice.org> ---
I can't reproduce it in

Versió: 6.1.3.2
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.
--
You are receiving this mail because:
You are the assignee for the bug.
b***@bugs.documentfoundation.org
2018-12-10 23:07:17 UTC
Permalink
https://bugs.documentfoundation.org/show_bug.cgi?id=121262

David M <***@posteo.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |UNCONFIRMED
Ever confirmed|1 |0

--- Comment #3 from David M <***@posteo.net> ---
Thanks to Oliver & Xisco for responding.

Issue still present on latest stable version

Version: 6.1.3.2
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 6.1.3.2 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.
--
You are receiving this mail because:
You are the assignee for the bug.
Fortsæt læsning på narkive:
Søgeresultater for '[Libreoffice-bugs] [Bug 121262] New: User defined function returns argument not result with VBA support enabled' (spørgsmål og svar)
5
svar
what are programming languages?
startet 2007-11-14 02:15:22 UTC
programming & design
Loading...