+ Reply to Thread
Results 1 to 5 of 5

Code to work at the same time as other code???

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Code to work at the same time as other code???

    Hi everyone,

    I have the below code which produces a message box (no buttons) which pops up for 8 seconds with a message and then disappears. This is perfect and just what I want it to do.

    Sub MessBox()
    
      UFMessBox.LabelMessage.Caption = "Processing..."
      Application.OnTime DateAdd("s", 8, Now), "UnloadMessageBoard"
      
      UFMessBox.Show
      
    End Sub
    and

    Sub UnloadMessageBoard()
    
       UFMessBox.Hide
       
    End Sub
    The message appears after the user clicks 'Ok' on my userform. Because it takes a few seconds for the data to be entered I use the above message box to let the user know that their data is being processed. However of course my code which enters their form data runs after the above message code ends.

    Does anyone know if i can get the message to pop up and whilst its there for its 8 seconds, all my other code runs at the same time?

    Is this possible?

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Code to work at the same time as other code???

    You would need to set the userform as vbModeless

  3. #3
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Code to work at the same time as other code???

    Show the userform modelessly:

    UFMessBox.Show vbModeless

  4. #4
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Code to work at the same time as other code???

    Thanks Firefly - i'll give that a bash.

    (never heard of that before!)

  5. #5
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Code to work at the same time as other code???

    Hi Firefly,

    Its coming up with the following:

    Run time error 401
    Can't show non-modal form when modal form is displayed

+ 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