I'll try. If you look at the VBA dll in the object library, on the left
side marked "classes", several icons indicating regular modules (*.bas)
show up: Constants, Conversions, DateTime, etc.
In my code, I define a type with the following elements:
Type KeyControl
strKey As String
MyControl As VB.Control
MyButton As VB.CommandButton
End Type
Because of the presence of Control and CommandButton, I must place this
type in a Basic module. If I attempt to put it in a class, I get the
following error message: "Private object modules can not be used in public
object modules as parameters or return types for public procedures, as
public data members, or as fields of public user defined types."
When I wish to include the KeyControl type in my class module, my
workaround solution is to include a basic module with the type definition
in it. I must also include the same basic file in any executable file
that also references KeyControl. The workaround is not heinously odious,
but it is less elegant than it would be if I could create a reference to
KeyControl in my DLL. And if anyone else were to use my program, said
person would have to be made aware of this little extra piece of
bookkeeping.
My observation of the VBA DLL in my object browser led me to believe that
such a reference is possible.
--Peter Ferber