<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - "CallByName" does not work when argument or returned value is an array"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=138155">138155</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"CallByName" does not work when argument or returned value is an array
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0.2.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>BASIC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jp@ledure.be
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
The CallByName builtin function allows for the dynamic execution of a method
given by its name.
The arguments of CallByName are:
1. The Basic object on which to apply the method
2. The name of the method as a string
3. The call type (1 for a usual method)
4+. The effective arguments of the method

When one of the arguments (4+) is an array, then next error is raised:
BASIC runtime error. Incorrect property value.

The same error is raised when the value returned by the called method is itself
an array.

For any other variable type, including a Basic  object, a user-defined type,
etc, CallByName works fine.

Steps to Reproduce:
1. In the Basic IDE, store next code in module Module1 of any (may be empty) LO
document:
Option Explicit
Option Compatible
Sub TestCallByNameArray()
Dim a,b,c,d,e,f,g
Const vbGet = 2, vbLet = 4, vbMethod = 1, vbSet = 8
        Set a = Module2
        b = Array(1,2,3)        
        c = CallByName(a, "SomeMethod", vbMethod, b)
End Sub

2. Store next code in Module2 of the same document:
Function SomeMethod(arr as Variant) As Variant
        SomeMethod = arr
End Function

3. Run the TestCallByNameArray() Sub


Actual Results:
"BASIC runtime error. Incorrect property value." on the line:
c = CallByName(a, "SomeMethod", vbMethod, b)


Expected Results:
The variable "c" should contain the output of the called function, i.e.
Ayyar(1,2,3).


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.2.2
Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994
CPU threads: 6; OS: Linux 5.4; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>