Problem with Type in a class module...

  • Thread starter Thread starter darlove
  • Start date Start date
D

darlove

Hi.

This is an excerpt from the Help files:

"In standard modules and class modules,
user-defined types are public by default.
This visibility can be changed using the
Private keyword."

This is very curious (and mysterious?)
because I want to declare a public
type in a class module and the VBE
protests. Anybody in the know?

Darek
 
I'd say the Help document errs.

Why do you want a public user-defined type in a class module? Any
element of a private user-defined type could be "made public" via
public Property Let and Property Get statements of the class.

Hth,
Merjet
 
Indeed help is misleading, but no can do. It makes sense, your own UD type
in a class module would cause serious compile problems when used elsewhere
until an instance of your class exists, not to mention the possibility of
multiple instances of the same class.

Same goes for public constants and declares. However I've never quite
understood why a normal array can't be public in a class.

Regards,
Peter T
 
Back
Top