Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Status in Window

Status
Not open for further replies.

tallygirl

Technical User
Mar 26, 2009
3
US
Is there a way to display a status bar to the user in a message box type window, while the application is running? My users keep hitting the macro button, thinking that nothing is happening, so the macro runs several times. These users need a sign in front of their face to tell them that something is happening and to be patient. The status in the bottom left corner is not enough of a visual cue.
 



Hi,

Is your user a rock?

You might use a UserForm inplace of the status bar to display a message.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
But won't that require the user to hit OK, in order for the code to continue running? I want to be able to tell the user that something is happening and to wait, but not have to wait for them to hit OK before continuing. To answer your first qeustion. They are machine opreators. They are not computer-savvy. I have to make it as fool-proof as possible.
 
Your button could open a modal UserForm that displays appropriate infos, runs the macro code and then automatically close.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Create a form with a single label control in the center. For this example, I've named the form, frmWait, and the label, lblStatus. In the form's code, place the following:
Code:
Public Property Let Status(Text As String)
    lblStatus.Caption = Text
    Me.Repaint
End Property
Then your macro can operate similar to this:
Code:
Public Sub LongRunningMacro()

    frmWait.Status = "This may take a while, please be patient ..."
    
    frmWait.Show (False) [green]'False makes the form modeless so it won't stop for user input[/green]
    
    Application.Wait (Now + TimeValue("0:00:10"))
    
    frmWait.Status = "Almost done ..."
    
    Application.Wait (Now + TimeValue("0:00:10"))
    
    Unload frmWait

End Sub
 
THANK YOU ALL! You have all been a great help. I had not used the userform very much, so this was a new experience for me. Thank you so much for showing me something new. This is exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top