how to add message box after a macro is completed

  • Thread starter Thread starter wendy
  • Start date Start date
W

wendy

help please. I have macro that i will like user to know
when the process has been completed. I think i will have
to create a form and then creat a message box macro
saying "process is completed". I am new to macro so I
will please like to the know what i will need. Also, i
need this message or prompt to appear infront of any
application that might be opened.
thanks in advance
 
wendy said:
* i need this message or prompt to appear infront of any
application that might be opened. *

Hello wendy,

In this case, I recommend to use "WScript.Shell" as follows. ;)



Code:
--------------------

Sub YourProcedule()
Dim WScript As Object
Set WScript = CreateObject("WScript.Shell")

'Your code here

WScript.Popup "Excel Upload Complete", 2, "process is completed", vbSystemModal
Set WScript = Nothing
End Sub

--------------------
 
thanks colo. I added it but i am getting an erorr.
This is how my code looks like with your codes:
Sub teacher()
Dim WScript As Object
Set WScript = CreateObject("WScript.Shell")

'the rest of my codes with ends with
application.visible=false
WScript.Popup "Excel Upload Complete", 2, "process is
completed", vbSystemModal
Set WScript = Nothing
End Sub

then
 
First let me thank you for been so helpfull. everything
works well as it wast, expect at the end it gives me this
error:
"Run-time error '424'. object required
This only happens when i add your code.
 
The code you posted runs fine for me in xl2000, windows 2000

Is the constant vbSystemModal defined?

msgbox vbSystemModal

does the code you posted work (just that code, not combined with your
original)?
 
Back
Top