Closing a file with macros

  • Thread starter Thread starter Alberto Ast
  • Start date Start date
A

Alberto Ast

I want to close an excel file that has been modified but I do not want to be
ask if i want to save changes.. if I do as follows

Windows("Excel file name.xls").Activate
ActiveWorkbook.Close

Excel will ask me if I want to save changes... I do not want this... just
close it.
 
hi
try this.........
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True

regards
FSt1
 
Or

workbooks("Excel file name.xls").close savechanges:=false

No need to activate it first.
 
Back
Top