Hi,
is it possible to check if a specific form is loaded into memory?
Thanks,
Jos Vens
Hi,
is it possible to check if a specific form is loaded into memory?
Thanks,
Jos Vens
"Jos Vens" <jos.vens@pro.tiscali.be> wrote in message
news:%23p5757KBFHA.208@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> is it possible to check if a specific form is loaded into memory?
>
> Thanks,
> Jos Vens
>
>
It's possible to test whether a form is being shown. That's perhaps not what
you meant.
/Fredrik
Hi Fredrik,
yes it is, I just want to test if a form is shown or not but how?
Thanks
Jos
"Fredrik Wahlgren" <fredrik.p.wahlgren@mailbox.swipnet.se> schreef in
bericht news:Ognf%23QLBFHA.2112@TK2MSFTNGP09.phx.gbl...
>
> "Jos Vens" <jos.vens@pro.tiscali.be> wrote in message
> news:%23p5757KBFHA.208@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> is it possible to check if a specific form is loaded into memory?
>>
>> Thanks,
>> Jos Vens
>>
>>
>
> It's possible to test whether a form is being shown. That's perhaps not
> what
> you meant.
>
> /Fredrik
>
>
Hi Jos,
Private Function FormIsLoaded(UFName As String) As Boolean
Dim UF As Integer
For UF = 0 To VBA.UserForms.Count - 1
FormIsLoaded = UserForms(UF).Name = UFName
If FormIsLoaded Then Exit Function
Next UF
End Function
Sub Test()
'Load UserForm1
MsgBox FormIsLoaded("UserForm1"), 64
'If FormIsLoaded("UserForm1") Then Unload UserForm1
End Sub
Regards,
MP
"Jos Vens" <jos.vens@pro.tiscali.be> a écrit dans le message de
news:%23p5757KBFHA.208@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> is it possible to check if a specific form is loaded into memory?
>
> Thanks,
> Jos Vens
>
>
Thanks a lot Michel!
Your code does the job I wanted,
Jos
"Michel Pierron" <michel.pierron@free.fr> schreef in bericht
news:%23g9$3YSBFHA.1392@tk2msftngp13.phx.gbl...
> Hi Jos,
>
> Private Function FormIsLoaded(UFName As String) As Boolean
> Dim UF As Integer
> For UF = 0 To VBA.UserForms.Count - 1
> FormIsLoaded = UserForms(UF).Name = UFName
> If FormIsLoaded Then Exit Function
> Next UF
> End Function
>
> Sub Test()
> 'Load UserForm1
> MsgBox FormIsLoaded("UserForm1"), 64
> 'If FormIsLoaded("UserForm1") Then Unload UserForm1
> End Sub
>
> Regards,
> MP
>
> "Jos Vens" <jos.vens@pro.tiscali.be> a écrit dans le message de
> news:%23p5757KBFHA.208@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> is it possible to check if a specific form is loaded into memory?
>>
>> Thanks,
>> Jos Vens
>>
>>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks