Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob Phillips wrote:
Public Function CreateClass1() As clsClass1 Set CreateClass1= New clsClass1 End Function You need to use a generic object type as the class object is not known in that workbook If the class's Instancing property is changed to PublicNotCreatable then it is known and can be declared as the class type e.g. Dim myClass As VBAProject.clsClass1 where VBAProject is the name of the VBA project to which the reference has been set (optional but recommended). In fact, I think the class in your example must already be PublicNotCreatable, otherwise I think you would have to declare the return type of your CreateClass1 function as Object. Jamie. -- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Accessing VBA subroutines in another workbook | Excel Programming | |||
Accessing workbook info from a different workbook macro | Excel Programming | |||
Accessing workbook info from a different workbook macro | Excel Programming | |||
calling from one workbook the classes and functions in another | Excel Programming | |||
Using classes defined in an add-in | Excel Programming |