Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your reply.
Your method works, but I prefer the suggestion made by Tom Ogilvy where you only need to change the Dim statement. Chip Pearson vient de nous annoncer : Try using the VBA.UserForms object. For example, Sub AAA() ShowAnyForm "frmMyForm2" End Sub Sub ShowAnyForm(FormName As String) Dim N As Long With VBA.UserForms N = .Count .Add FormName .Item(N).Show End With End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "Michel S." wrote in message ... hello ! I have a userform for which I want to programmatically set/change properties in a function before displaying it. Instead of hardcoding the form's name at many places in the function, I'd like to assign it to a form object and use this object in my function. How can I do it ? I tried : Dim frm AS MSForms.UserForm Set frm = frmActualFormName Using this syntax, I can access and edit form's controls, but when the program reaches : frm.Show I get an error 438 : Object doesn't support this property or method. Why ? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
438 - Object doesn't support this property or method | Excel Programming | |||
Object doesn't support this method | Excel Programming | |||
Union method for Range Object | Excel Programming | |||
Unsupported object or method... | Excel Programming | |||
Method ~ of Object ~ Failed. | Excel Programming |