VB Popup Alert Help?

R

RoadKill

I have a script to send email attachments via a button on my excel sheets.

I also used to have a script that popped up an alert window when a script
was done running but can't seem to locate it right now.

I think it was just a simple one line bit of code.

Can someone give an example of one or point me in the right direction?

Basically my users aren't always savvy enough to check their sent box to see
if the email actually was sent so am thinking this alert would let them know
that the script did in fact run properly and sent the email. It might keep
them from clicking the button like crazy and sending countless unneeded
copies.

Thank you
 
C

Chip Pearson

You can use a MsgBox:

MsgBox "We're Done",vbOkOnly

This will remain displayed and no other code will run until the user
clicks a button on the box.

You can also display a message box that will automatically close after
some number of seconds:

Dim Obj As Object
Set Obj = CreateObject("wscript.shell")
Obj.Popup "We're Done", 3

This will automatically close after 3 seconds. Side note: I couldn't
get the timeout to work on my 64-bit machine, but it worked fine on my
32-bit machine.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]
 
J

JLatham

If by script, you mean a VBA macro to send the email, then put something like
this somewhere near the end of the code:

MsgBox"Your email has been sent"
 
R

RoadKill

Thank you both!

Chip Pearson said:
You can use a MsgBox:

MsgBox "We're Done",vbOkOnly

This will remain displayed and no other code will run until the user
clicks a button on the box.

You can also display a message box that will automatically close after
some number of seconds:

Dim Obj As Object
Set Obj = CreateObject("wscript.shell")
Obj.Popup "We're Done", 3

This will automatically close after 3 seconds. Side note: I couldn't
get the timeout to work on my 64-bit machine, but it worked fine on my
32-bit machine.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




I have a script to send email attachments via a button on my excel sheets.

I also used to have a script that popped up an alert window when a script
was done running but can't seem to locate it right now.

I think it was just a simple one line bit of code.

Can someone give an example of one or point me in the right direction?

Basically my users aren't always savvy enough to check their sent box to see
if the email actually was sent so am thinking this alert would let them know
that the script did in fact run properly and sent the email. It might keep
them from clicking the button like crazy and sending countless unneeded
copies.

Thank you
.
 

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