Automatically respond to message box appearing within a VBA macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Within a macro routine I am creating a .prn file and saving over an exisiting
file. Every morning this macro runs and a prompt appears asking if I am sure
I want to overwrite the existing file. The user must click "Ok" in order for
the routine to continue. Is there some syntax in which the macro will
automatically answer the msg box?
 
try this:
insert:
Applictaion.DisplayAlerts = false
at the star of your code then
Application.DisplayAlerts = true
just before the end sub statement

Mike
 
try:

Application.DisplayAlerts = False
'
' your code
'
Application.DisplayAlerts = True

Regards

Trevor
 
MikeW and Trevor Shuttle, you both answered the question wonderfully.
Thanks, you saved 5 keystrokes performed every morning!
 
Back
Top