Article ID: 162257
Article Last Modified on 1/19/2007
Public Processing_Message As String
Public Macro_to_Process As String
Sub StartProcessing (msg As String, code As String)
Processing_Message = msg 'Set the message that is displayed
'in the dialog box
Macro_to_Process = code 'Set the macro that is run after the
'dialog box is active
Processing_Dialog.Show 'Show the Dialog box
End Sub
Property Setting
-------------------------------------
Name Processing_Dialog
Caption (Leave Blank)
StartUpPosition 2-CenterScreen
Private Sub UserForm_Initialize()
lblMessage.Caption = Processing_Message 'Change the Label
'Caption
End Sub
Private Sub UserForm_Activate()
Me.Repaint 'Refresh the UserForm
Application.Run Macro_to_Process 'Run the macro
Unload Me 'Unload the UserForm
End Sub
Sub MyMacro()
For x = 1 to 5000
Application.StatusBar = x '5000 Iterations Changing
'StatusBar
Next
Application.StatusBar = False 'Reset the StatusBar
End Sub
Sub Main()
'Call the StartProcessing procedure to show the Processing_Dialog
'with the label "Processing, Please Wait..." and execute
'MyMacro.
StartProcessing "Processing, Please Wait...", "MyMacro"
End Sub
Sub Main()
StartProcessing "<message text>", "<macro name>"
End Sub
Where the <message text> argument is the text string that you want to
display in the Processing_Dialog dialog box and <macro name> is the
macro that you would like to run after the dialog box appears. To show
the dialog box and run the macro indicated by "<macro name>", run the
macro Main.
148209 XL: How to Create a Temporary Message Box While Macro Runs
Additional query words: OffInterop xlvbahowto xlvbainfo 8.00 97 execute executing background off97 xl97 word97 splash screen
Keywords: kbcode kbhowto kbprogramming KB162257