display alerts= false not working

E

ezil

Display alerts = false is not working suddenly. Previously when I use in
macros it was working. So I tried following example then also it gives the
alert message
"save changes yes or no?" e.g 2 also gives alert message

Example
This example closes the workbook Book1.xls and doesn’t prompt the user to
save changes. Any changes to Book1.xls aren’t saved.

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

eg:2 Workbooks("BOOK1.XLS").Close SaveChanges:=False
 
N

Norman Jones

Hi Ezil.



Workbooks("BOOK1.XLS").Close _
SaveChanges:=True

Should save any chnages and close the workbook
without any message


Similarly

Workbooks("BOOK1.XLS").Close _
SaveChanges:=False

should close the workbook without saving any changes
and without any alert message.

Alternatively,

Application.DisplayAlerts = False
Workbooks("Book2").Close
Application.DisplayAlerts = True

would also close the workbook without saving any c
hanges and without any warning.

Are you saying that your experience is different?
 

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