Table of contents
TOC
Collapse the table of content
Expand the table of content

A procedure with a ParamArray argument cannot be called with named arguments

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

All arguments in a call to aprocedure defined with a ParamArray must be positional. This error has the following cause and solution:

  • Named-argument syntax appears in a procedure call.

    The named-argument calling syntax can't be used to call a procedure that includes a ParamArray parameter. To supply only some elements of the ParamArray, use commas as placeholders for those elements you want to omit. For example, in the following call, if the ParamArray arguments begin after Arg2, values are being passed only for the first, third, and sixth values in the ParamArray:

MySub Arg1, Arg2, 7,, 44,,,3 
 **Note**  The  **ParamArray** always represents the last items in the argument list.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

© 2018 Microsoft