Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I managed to get to this late today, and it worked very nicely. Thanks for your
assistance. Bill ---------------------------- Chip Pearson wrote: You can't directly share a class module between projects. You can, however, have a public function in the workbook that contains the class that returns as its result a new instance of the class. For example, suppose WB1.xls has a project name of MyProj and a class named CMyClass. Then, set a reference from WB2.xls to WB1.xls (in VBA go to the Tool menu, choose References, and check MyProj). Then in a code module in WB1.xls, create a function Public Function GetClass As CMyClass Set GetClass = New CMyClasss End Function In WB2.xls, instantiate the class with code like Public Sub AAA() Dim C As MyProj.CMyClass Set C = MyProj.GetClass ' more code End Sub Ensure that the Instancing Property of the Class is PublicNotCreatable, not Private. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CLASS MODULE & SIMPLE MODULE | Excel Discussion (Misc queries) | |||
Class module | Excel Programming | |||
Class module | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |