+ Reply to Thread
Results 1 to 5 of 5

Displaying two consecutive userforms as modeless

  1. #1
    Registered User
    Join Date
    11-16-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Displaying two consecutive userforms as modeless

    Hi,

    I've searched the internet and all my resources for an answer to my problem, but have been unable to figure it out, so I'm starting a thread here.

    I want to display two consecutive userforms, both of which serve as simple status messages updating the user on the status of the macro running in the background. Since the macro goes through two phases, I let the user know when it is in each phase with the two userforms.

    I display the first userform, let's call it UserForm1, using

    UserForm1.Show vbModeless

    Then, I unload this userform. However, since sometimes the macro runs too fast to let the user read the message, I used Application.Wait to pause the macro for a second before unloading UserForm1. So far so good. Then, after the first part of the code runs, I display the second userform, let's call it UserForm2, using the same command:

    UserForm2.Show vbModeless

    However, when I show this one, you can't read the text in it, just the caption. The userform itself is blank, even if I use the wait command. I cannot figure out why this is and how to resolve it so that the text in the second userform is visible.

    Any ideas?

    Thanks in advance,
    jd

  2. #2
    Registered User
    Join Date
    11-16-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel VBA: displaying two consecutive userforms as modeles

    Can anybody out there help? This is killing me and I've exhausted searching on the internet for some sort of resolution. I know there must be a way ....

    Thanks in advance,
    jd

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Excel VBA: displaying two consecutive userforms as modeles

    we really need to see your code. Can you create and post a working example that demonstrates the problem.

    Can we assume you set the caption of the label on the 2nd form correctly?
    Have you tried using a DoEvent command in order to allow the system to process any outstanding instructions.
    Or maybe just a repaint of the userform on activate.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel VBA: displaying two consecutive userforms as modeles

    I'd definitely go with the Repaint:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    11-16-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Displaying two consecutive userforms as modeless

    romperstomper: repaint works perfectly and is exactly what I was looking for since it's so simple (I knew there had to be an easy way). Thanks very much.

    jd

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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