https://bugs.documentfoundation.org/show_bug.cgi?id=145279
Rafael Lima <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #4 from Rafael Lima <[email protected]> --- In Excel if you remove the parenthesis from the line "Add1(a)" it will return 11 in both cases. It should look like: Sub Main() MsgBox Plus1() MsgBox Plus1(10) End Sub Function Plus1(Optional a) If IsMissing(a) Then a = 10 Add1 a ' <--- Note the change here Plus1 = a End Function Sub Add1(ByRef a) a = a + 1 End sub It must have something to do with evaluation of expressions... when there is parenthesis, it is treated as an expression instead of a variable being passed by reference. So removing the parenthesis make it work as expected on Excel. However, on LibreOffice Basic the error persists even when the parenthesis is removed. So I believe this is a bug. -- You are receiving this mail because: You are the assignee for the bug.
