Thread: UserForm usage
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Michel Pierron Michel Pierron is offline
external usenet poster
 
Posts: 214
Default UserForm usage

Hi Eric,

Public Sub displayForm(form As Object, mode As FormShowConstants)
Load form
form.Show mode
End Sub

MP

"Eric" a écrit dans le message de
k.net...
I want a generic way to show a UserForm, which I coded as

Public Sub displayForm(form As UserForm, mode As Integer)
Debug.Assert mode = vbModal Or mode = vbModeless
Load form
form.Show mode
End Sub

The method fails,as the UserForm object does not support the Show method.

My
question is why does the 'actual' form, which *is* a UserForm, work?
KeyMgtForm.Show vbModeless ----------- works fine

So, is there another object that I can cast the UserForm to that will

work?

TIA