Show or hide warning messages by using Visual Basic
- Open a Function or Sub procedure in the Code window.
- In the place in the procedure where you want to stop or resume the display of modal warning messages, use the SetWarnings method to carry out the SetWarnings action.
How?
- To temporarily stop the display of warning messages, set the warningson argument to False. To resume displaying them, set the warningson argument to True.
- Run the procedure.
How?
When the code stops running, the display of warning messages automatically resumes.
For more information about the SetWarnings method, click .