View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Close all without saving and exit without prompts

I'm inclined to go with this modified version of Claus' offering...

Sub Test()
Dim wkb As Workbook

For Each wbk In Workbooks
If wkb.Visible And wkb < ThisWorkbook Then _
wkb.Close SaveChanges:=False
Next
With Application
.DisplayAlerts = False: .Quit: .DisplayAlerts = True
End With
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com