+ Reply to Thread
Results 1 to 5 of 5

vbModeless form problem?

  1. #1
    Registered User
    Join Date
    08-12-2011
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    20

    Question vbModeless form problem?

    Hello -

    I feel like this should be a relatively easy fix. I am trying to show a quick and dirty form (which simply says "please wait...") when a user clicks a button. The particular macro I'm working with takes about 3-4 seconds to run. I tried to figure this out using a Google search, but I'm not having any luck. The code I have now is:

    Please Login or Register  to view this content.
    I am using vbModeless because I want the rest of my code to execute in the background of this form being displayed so the user doesn't have to click anything to allow the code to continue. The form comes up entire white on my screen though, and it should have a grey background with the text "Please wait..."

    Thoughts? Ideas? Am I doing something wrong?
    Last edited by tom_19; 08-25-2011 at 04:28 PM.

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: vbModeless form problem?

    Hi Tom,

    Try:

    Please Login or Register  to view this content.
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    08-12-2011
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: vbModeless form problem?

    Thanks Colin! That did the trick. Any idea why this was happening? Could I be doing something wrong or have a property set incorrectly, or is this just a known nuance of Excel?

  4. #4
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: vbModeless form problem?

    Hi Tom,

    You're not doing anything wrong. You've just got to give Excel the resources to paint the userform correctly on the screen and explicitly calling RePaint is the cleanest way to do it. Another way, which is not quite as clean, is to use DoEvents.

  5. #5
    Valued Forum Contributor
    Join Date
    07-21-2008
    Location
    London, UK
    Posts
    326

    Re: vbModeless form problem?

    look at .Repaint its an excel thing,, way it works,

    Some use a hammer other cleaner depends what you want

    Try it

+ 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