DisplayAlerts property is not changing to False

M

myoung

Hello All:

My excel application neglects to chenge the propert
Application.DisplayAlerts to false.
Here is the code:

Application.DisplayAlerts = False
Application.Quit

When I step through the code and check the displayalerts property it i
set to true.

I have been reading other entries and can not seem to find a definit
problem/resolution (not to mention no particular help from Microsoft).

I have tried the
"workbooks(name.xls).close SaveChanges:=False"
(changes are not to be saved) method but this throws an exception whe
I try to quit.

Any thoughts?

Thanks,

Mik
 
M

Michael

Mike,

You may want to try using the saved property of the
Workbook Object. For example:

ThisWorkbook.Saved = True
Application.Quit

If you have more than one workbook open and you want all
of them closed without saving any of them, try:

Dim wkBooks
Dim wkBook

Set wkBooks = Application.Workbooks

For Each wkBook In wkBooks
wkBook.Saved = True
wkBook.Close
Next wkBook
Application.Quit

Hopefully that helps.

Michael
 

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