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

This page is specific to the Visual Basic for Applications (VBA) Language Reference for Office 2010.

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).