VBA – Prevent warning messages from a macro

Associated Files Download Links

When writing a macro there are times when you don’t need to prompt the user with the default warning messages, like “Ok to delete sheet?”. To turn off the default warning messages, add this code to your macro.

Disable Warning Messages in Excel

To prevent warning messages, place this code in your macro

Enable Warning Messages in Excel

And don’t forget to turn them back on at some point in your macro

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro – A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!

alt text

Learn More!

<<Return to VBA Examples

Did you find this VBA tutorial useful? Then share it with your friends and colleagues:

You may also like some of this related content...

If your template design requires making Excel look less like Excel, you might want to
You can change the default username with vba. This is the default name that shows
When creating an Excel template you may want to turn off the formula bar to
You can modify the titlebar to whatever text you'd like. We make usre of the
Page Break Preview Mode To place Sheet1 in Page Break Preview View from code: Sheet1.Activate