Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Class Module Scope
Howdy All,
Is it possible to create an object from a class module in another workbook. I created a reference to the other workbook, but that didn't do the trick. TIA Trent |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Class Module Scope
Trent,
You can change the instancing property of the class to "Public Not Creatable" which will allow you to declare a variable of that class type, but not create an instance of the class. In the project that contains the class, create a public function in a standard code module that create a new instance of the class and returns a reference as its result. For example, ' in the project that contains Class1 Public Function CreateClass () As Class1 Set CreateClass = New Class1 End Function ' in the project that need a Class1 variable Dim C1 As ProjName.Class1 Set C1 = ProjName.CreateClass() -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Trent Argante" wrote in message ... Howdy All, Is it possible to create an object from a class module in another workbook. I created a reference to the other workbook, but that didn't do the trick. TIA Trent |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Class Module Scope
Chip,
That did the trick. It's nice & clean, too. Thank you, very much. Trent *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating UDF by Class Module (Leo)? | Excel Discussion (Misc queries) | |||
CLASS MODULE & SIMPLE MODULE | Excel Discussion (Misc queries) | |||
Class module | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming | |||
how to declare a class module | Excel Programming |