Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Global Classes be created in Excel

Status
Not open for further replies.

bdbBear

Programmer
Apr 29, 2005
54
US
Working in WinXP/2K3.

I created a class module that I want to instantiate at Workbook_Open(). I want to be able to refer to it from any worksheet (or other class or module) until Workbook_BeforeClose().

Is this possible? I've tried the following (my class is called Message) in the Workbook but I get error messages.

Public mMsg As Message

Property Get Msg() As Message
Msg = mMsg
End Property

Property Let Msg(ByVal v As Message)
mMsg = v
End Property

The message I get is ...

Private object modules cannot be used in public object moduels as parameters or return types for public procedures, as public data members, or as fields of publis user defined types.

Thanks!

- Bruce
 
Bruce,

Your declaration, Public mMsg As Message, should be placed at the beginning of a standard code module.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top