Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Instances of a Class
Stig,
Declare you class instance in a module, so it is globally available. You can't use them on a worksheet, as they are object, so you cannot pass them to UDF. But you can pass them to a VBA function. 'assume this is you global variable that has suitably instantiated Public MyInst as MyClass 'and you have function in a module Public Function DoSomeWork(argIn as MyClass) As Long With argIn....etc End Function You can call it with Call DoSomeWork(MyInst) Not sure what you mean "hell" in this case. NickHK "STIG" wrote in message ... Hi! I have a class Person, wich have it`s own properties and functions. When creating instances of such a class, I would like to have them globally avalable in excel, so that I can use them as input arguments in general module UDF`s. Later on I would like to create controls for some of their properties by means of some UserForm. After I have created an object, wich hell do they recide in, and how can I get a hold of them. Can I make my own hell to store them in? And how do I pass them to a function from a spreadsheet cell using "=function()" syntax? Novice Norwegian |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create list of unique instances from list of multiple Instances | Excel Worksheet Functions | |||
Class programming - how to return chartobject from a class? | Excel Programming | |||
Class modules: parametrize class object fields | Excel Programming | |||
RaiseEvent from a class contained in a 2nd class collection? | Excel Programming | |||
Is there an easy way to replace list A instances with list B instances (sorted lists). | Excel Programming |