SbRtl_IsNull [1] is explicitly designed to return True when passed an empty object value. (This is since the initial import commit, so was always the same.) Dim o As Object MsgBox IsNull(o) ' shows "True" However, this is inconsistent with VBA, where the same code gives False. So the function must consider VBASupport, and exclude the object variable test when VBA support is enabled. [1] https://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx?r=fffc6b40&mo=70055&fi=2482#2482
I can confirm the bug. I tested the following code in LibO Basic: Sub TestIsnull Dim a As Object MsgBox IsNull(a) Set a = Nothing MsgBox IsNull(a) a = Array(1, 2, 3) MsgBox IsNull(a) End Sub It returns True, True and False regardless of VBA support being enabled or not. However in Excel VBA, the code below returns False in all MsgBox statements. Sub TestIsnull Dim a As Object MsgBox IsNull(a) Set a = Nothing MsgBox IsNull(a) Set a = Range("A1") MsgBox IsNull(a) End Sub
Proposed patch available for review at: https://gerrit.libreoffice.org/c/core/+/128050
(In reply to Rafael Lima from comment #2) > Proposed patch available for review at: > https://gerrit.libreoffice.org/c/core/+/128050 The patch is abandoned. Resetting assignee. @Andreas, I thought you might be interested in this issue