How do I temporarily turn off messages in Excel

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

Guest

How do I temporarily turn off messages in Excel, i.e. "Do you want to save
changes?". I'm running a macro that opens other workbooks and copies data to
my current file and then closes the other workbooks. I need to turn off
warning messages, and then turn them back on at the end of the macro.
 
Hi,

1.
When you close the other books, use:
Workbooks("my other book").Close False
The False option explicately tells not to save, therefore no message appears.

2. For most xl messages
application.DisplayAlerts=False 'turn messaging off
'...code
application.DisplayAlerts=true
 
Thanks, the Workbook.Close False worked great in this instance, and I'm sure
I will be using the Dispaly Alerts = False/True in the future.

Thanks again!
 
Back
Top