+ Reply to Thread
Results 1 to 5 of 5

How check if form is loaded?

  1. #1
    Jos Vens
    Guest

    How check if form is loaded?

    Hi,

    is it possible to check if a specific form is loaded into memory?

    Thanks,
    Jos Vens



  2. #2
    Fredrik Wahlgren
    Guest

    Re: How check if form is loaded?


    "Jos Vens" <[email protected]> wrote in message
    news:%[email protected]...
    > 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



  3. #3
    Jos Vens
    Guest

    Re: How check if form is loaded?

    Hi Fredrik,

    yes it is, I just want to test if a form is shown or not but how?

    Thanks
    Jos

    "Fredrik Wahlgren" <[email protected]> schreef in
    bericht news:Ognf%[email protected]...
    >
    > "Jos Vens" <[email protected]> wrote in message
    > news:%[email protected]...
    >> 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
    >
    >




  4. #4
    Michel Pierron
    Guest

    Re: How check if form is loaded?

    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" <[email protected]> a écrit dans le message de
    news:%[email protected]...
    > Hi,
    >
    > is it possible to check if a specific form is loaded into memory?
    >
    > Thanks,
    > Jos Vens
    >
    >



  5. #5
    Jos Vens
    Guest

    Re: How check if form is loaded?

    Thanks a lot Michel!

    Your code does the job I wanted,

    Jos


    "Michel Pierron" <[email protected]> schreef in bericht
    news:%[email protected]...
    > 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" <[email protected]> a écrit dans le message de
    > news:%[email protected]...
    >> Hi,
    >>
    >> is it possible to check if a specific form is loaded into memory?
    >>
    >> Thanks,
    >> Jos Vens
    >>
    >>

    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1