View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Michel S. Michel S. is offline
external usenet poster
 
Posts: 33
Default form object doesn't have a show method ?

Thanks !

I used the second method to benefit from Intellisense working too;
since the two lines :

Dim frm AS MyForm
Set frm = MyForm

are one below the other, it will be easy to change, if ever required.


Tom Ogilvy avait énoncé :
try

Dim frm AS Object

that worked for me.

Userform is a generic class, when you create a new userform, it is its own
type.

assume the form is show in the project explorer as MyForm

then you could use

Dim frm as Myform

that will also work.

--
regards,
Tom Ogilvy

"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.