Article ID: 184256
Article Last Modified on 6/23/2005
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 'Display 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 display the
' Processing_Dialog with the label "Processing, Please Wait..."
' and execute MyMacro.
StartProcessing "Processing, Please Wait...", "MyMacro"
End Sub
Additional query words: OffInterop xlvbahowto xlvbainfo 8.00 execute executing background xl98 wd98 splash screen OFF98
Keywords: kbhowto kbcode KB184256