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

User-defined type may not be passed ByVal

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

User-defined types can only be passedby reference (the default), notby value. The error may not be reported until the call is made. This error has the following cause and solution:

  • You placed a ByVal keyword in the definition of aparameter that represented a user-defined type.

    Remove the ByVal keyword. To keep changes from being propagated back to the caller, Dim a temporaryvariable of the type and pass the temporary variable into theprocedure.

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

© 2018 Microsoft