Problem with Type in a class module...

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
 
M

merjet

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
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top