Can't have paramarrays with optional arguments

Use a ParamArray to define procedures that accept variable-length argument lists. An Optional argument is one that the caller can supply or omit without generating an error. This error has the following causes and solutions:

  • You used both the ParamArray and Optional keywords in the same parameter list. Remove either the Optional or ParamArray parameter. You cannot use both keywords in the same parameter list. Either approach can be used for the type of parameter list you want.

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.