Hello Steve,
I still don't know why your code won't work. It works fine on my machine. Are you using XL 2000 or XP?
Your code doesn't allow for more than one workbook being open so you'll still get a prompt if there is more than one workbook open which has been changed. You might want to try something like this:-
Sub CloseExcelv2()
Application.DisplayAlerts = False 'Override Excel messages
Application.Quit
End Sub
HTH,
Daniel.
Application.DisplayAlerts = False
Application.Quit
Thanks for your help. This works fine.
When using Application.Quit, if you have add-ins that run Auto-Close macros, it might cause Excel to crash. Also don't put any code after Application.Quit - it won't be run in Excel 97/2000.