Not all variables in an object module can be declared as Public. However, procedures are Public by default, and Property procedures can be used to simulate variables syntactically. This error has the following causes and solutions:
Although you can't declare a Public constant in an object module, you can create a Property Get procedure with the same name. If you don't create a Property Let or Property Set procedure with that name, you are in effect creating a read-only property that can be used the same way you would use a constant.
You can simulate fixed-length strings with a set of Property procedures that either truncate the string data when it exceeds the permitted length, or notify the user that the length has been exceeded.
Although a procedure can't return an array, it can return a Variant that contains an array. To simulate a Public array in a class module, use a set of Property procedures that accept and return a Variant containing an array.
Declare statements are implicitly public. Precede the Declare statement with the Private keyword.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).