Info Message without a response needed

L

Lemi

Excel 2007 & Windows XP pro
Some of the sub-operations in my UserForm take longer time than the others
and I want to display an info message something like "Processing..." or
"Refreshing..." during the process.
This message should not have any buttons and expect a user response. It is
supposed appear during the process without interrupting it and disappear
when process is over. Excel's MsgBox function has always a button waiting
for a response from the User.
I have come accross in the MS Knowledgebase "Call the Windows API function
MessageBox()" but I couldn't understand how. Also I am not sure if it is
relevant to my case. Can anyone help me how to solve this please?

Regards,
Lemi
 
R

Rick Rothstein

You could always use a Locked TextBox (make the caption say "Pending..." or
whatever else you want; and you can add text/background coloring if you want
to also) that has been placed on top of all the other controls (execute the
control's ZOrder method to do this)... start it off invisible, make it
visible just before you start your lengthy process add make it invisible
again afterwards.
 
L

Lemi

Thank you Rick and Roy,
I have developed a simpler solution myself..
I have added a label (desired message:"Refreshing, please wait...") with
visible set to off from the properties.
Then in the click event of the button that runs the sub-macro to refresh the
data I have made the label visible and repaint the userform just before
calling the macro. Make the label invisible again after the macro. Suppose
you have a main UserForm1 and a button named Accounts which runs the macro
named Select Account() and the messaging Label10 on the form

Private Sub Accounts_Click()
UserForm1.Label10.Visible=True
UserForm1.Repaint
SelectAccount
UserForm1.Label10.Visible=False
End Sub

Rgds/Lemi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top