Turning off and / or handling of warning message boxes.


Posted by David Mulley on December 01, 2001 2:37 AM

In a VB macro I saveas to create a new workbook with a specific name. If this file exists I want to over write it, but wnat my macro to run without user interaction to accept the over write warning message.

Likewise if I delete unwanted sheets I don;t want the user to have to accept the message.

Ideally with both of the above I want to run the macro which is a data collection and manipulation program totolly un attended during the night.

How can I do this.

Posted by JAF on December 01, 2001 5:15 AM

Change your macro by adding the following lines as shown:

Sub YourMacro()
Application.DisplayAlerts = False
'your existing code here
Application.DisplayAlerts = True
End Sub

That way, ALL alerts will be disabled between the False and True lines and should do what you need.



Posted by David Mulley on December 11, 2001 12:22 AM

Thank-you that is exactly what was required.