By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,073 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,073 IT Pros & Developers. It's quick & easy.

Display Message When VBA Code Run Successfully

P: 68
Hi,

Can anyone tell me how to dipaly a message if a VBA code run successfully.

Also, if you can recommend a good book that demonstrates the methods of handling errors on VBA.
Apr 28 '09 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 1,287
At the end of your function, right before Exit Sub or Exit Function, just do:
Expand|Select|Wrap|Line Numbers
  1. MsgBox "Completed successfully."
Reading a whole book on error handling, if one exists, would mostly be a waste of time. Take a look at the basics, and put the error handling code in every function you write.
Error Handling in VBA from Allen Browne - you can learn a lot from reading his Tips.
Apr 28 '09 #2

NeoPa
Expert Mod 15k+
P: 31,709
Some excellent advice there. I can only suggest a visit to the Help section does no harm too.

In any VBA area type Error then press F1 (Context sensitive help).
Apr 28 '09 #3

P: 68
thanks for you all.

I used to put a code when I was using Oracle Forms Builder that shows a message if the code was run successfully.

I know this will show a message to the user "Completed successfully." but in case a promblem happened the user will absolutely get two contradictory messages the error message and this one.

But now i might refer to the link below recommended by ChipR to deal with errors

Thanks all
Apr 29 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.