Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This worked for me.
Public Function ReadCaption(argUserForm As Object) Cheers Andy NickHK wrote: Chip, So if I wanted a generic routine in a class to deal with userforms e.g '**MyFormClass Public Function ReadCaption (argUserForm as UserForm) MsgBox argUserForm.Caption End Function Calling this from a cmd on a userform: Dim cFormHandler As MyFormClass cFormHandler.ReadCaption Me This will never work then because the object does not have such a property. I can't create routines for every userform used, passing in the speciifc userform, as in Public Function ReadCaption (argUserForm as UserForm1)... Public Function ReadCaption (argUserForm as UserForm2)...etc NickHK "Chip Pearson" wrote in message ... A generic userform object has very few properties. Most properties are created when the form is created. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "NickHK" wrote in message .. . '** In MyClass.cls Private XLUForm As UserForm Public Property Set XLUserForm(vData As UserForm) Set XLUForm = vData End Property '**Called from a userform called MyForm Set MyClass.XLUForm=MyForm Using the above code in a class in same WB as the passed UserForm, vData.Caption always evaluates to "". But if, whilst in the class, I test ?MyForm.Caption it returns the correct value. Also, properties like vData.Width are no longer "supported", but .InsideWidth is. If I change the declarations to: Private XLUForm As MyForm Public Property Set XLUserForm(vData As MyForm) everything is *normal*. Anyone explain why ? NickHK -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to reference win.caption, when caption changes | Excel Programming | |||
Userform Caption | Excel Programming | |||
How to format Userform caption? | Excel Programming | |||
Source of value passed to class object | Excel Programming | |||
UserForm Caption | Excel Programming |