Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Classes and Userform: Passing it around
I created a class and a userform. The userform has certain fields of
type dates, strings, etc. all of which I set a CLASS with propertieis. The class is created by the userform. After the user fills out the userform, I want the class so that I can use it within my worksheet workflow to calculate values for the worksheet. How do I get the class after the userform is closed? Does it exist in memory and how do I access it? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Classes and Userform: Passing it around
You could expose a public property in the user form that you can use to point
to an object variable that is defined in the worksheet. In this way, the userform would be manipulating an object that actually exists in the worksheet. When the userform is unloaded, the object would still be available in the worksheet. Or, you can also declare the object variable with a global scope. For example, in a module, declare it like this Global obj as New YourClass You can then access that variable anywhere in your VBA code. -- Hope that helps. Vergel Adriano "axwack" wrote: I created a class and a userform. The userform has certain fields of type dates, strings, etc. all of which I set a CLASS with propertieis. The class is created by the userform. After the user fills out the userform, I want the class so that I can use it within my worksheet workflow to calculate values for the worksheet. How do I get the class after the userform is closed? Does it exist in memory and how do I access it? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Classes and Userform: Passing it around
Declare the class in the code that launches the userform, then pass the
class to the userform as a property. Here's a simple example of userform properties: http://peltiertech.com/Excel/PropertyProcedures.html - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "axwack" wrote in message ps.com... I created a class and a userform. The userform has certain fields of type dates, strings, etc. all of which I set a CLASS with propertieis. The class is created by the userform. After the user fills out the userform, I want the class so that I can use it within my worksheet workflow to calculate values for the worksheet. How do I get the class after the userform is closed? Does it exist in memory and how do I access it? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing value to userform quetion | Excel Programming | |||
Passing Procuedure to Userform | Excel Programming | |||
Passing variables between Sub and Userform | Excel Programming | |||
Passing variables from module to userform | Excel Programming | |||
Passing a value to a variable from Userform | Excel Programming |