+ Reply to Thread
Results 1 to 4 of 4

Show Modeless Form

  1. #1
    Michael Malinsky
    Guest

    Show Modeless Form

    I've been working through the NG trying to perfect this, but to no
    avail. I'm trying to show a "Please Wait" modeless form (UserForm2) as
    my workbook has numerous occurrences of a UDF that are all recalculated
    when a user form (UserForm1) is closed. Here's my code:

    Private Sub CommandButton3_Click()

    UserForm1.Hide 'since I cannot show a modeless form while a
    modal form is showing
    UserForm2.Show vbModeless
    Unload UserForm1

    End Sub

    'Code for UserForm2
    Private Sub UserForm_Activate()

    UserForm2.Caption = "Please wait"
    Call Calculate
    Unload UserForm2

    End Sub

    Private Sub Calculate()

    Application.Calculate

    End Sub
    'End code

    Thanks,
    Mike.


  2. #2
    Jim Thomlinson
    Guest

    RE: Show Modeless Form

    While it is not a solution to your modeless issue why not just display a
    message right on your UserForm1 asking the user to wait or use the
    Application.StatusBar to display a message to the user. That seems a lot
    easier.
    --
    HTH...

    Jim Thomlinson


    "Michael Malinsky" wrote:

    > I've been working through the NG trying to perfect this, but to no
    > avail. I'm trying to show a "Please Wait" modeless form (UserForm2) as
    > my workbook has numerous occurrences of a UDF that are all recalculated
    > when a user form (UserForm1) is closed. Here's my code:
    >
    > Private Sub CommandButton3_Click()
    >
    > UserForm1.Hide 'since I cannot show a modeless form while a
    > modal form is showing
    > UserForm2.Show vbModeless
    > Unload UserForm1
    >
    > End Sub
    >
    > 'Code for UserForm2
    > Private Sub UserForm_Activate()
    >
    > UserForm2.Caption = "Please wait"
    > Call Calculate
    > Unload UserForm2
    >
    > End Sub
    >
    > Private Sub Calculate()
    >
    > Application.Calculate
    >
    > End Sub
    > 'End code
    >
    > Thanks,
    > Mike.
    >
    >


  3. #3
    Michael Malinsky
    Guest

    Re: Show Modeless Form

    You are right, both are easy, but I was looking for "pretty." The
    problem I'm running into is getting UserForm1 to unload before
    UserForm2 loads.

    Any other ideas?


  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Michael,

    Add a VBA module to project and copy this code into it. In the UserForm_Activate() code add this to call the macro...

    MakeNonModal

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ 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