Closing a file with macros

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.
 
F

FSt1

hi
try this.........
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True

regards
FSt1
 
A

Alberto Ast

Worked great thanks.

FSt1 said:
hi
try this.........
Application.DisplayAlerts = False
ActiveWorkbook.Close
Application.DisplayAlerts = True

regards
FSt1
 
D

Dave Peterson

Or

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

No need to activate it first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top