Private Enum and user-defined types cannot be used as parameters or return types for public procedures, public data members, or fields of public user-defined types

A Public procedure is visible to all modules in a project, while a Private Enum type is not visible outside its own module. This error has the following cause and solution:

  • Your Public procedure is in a Public class, but it returns a value or has a parameter that is defined in a standard module or in a Private class.

    Declare the Enum Public. It must be in a class module.

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.