kisinana
07-26-2008, 06:41 AM
Still searching for a way to close second date that macro seems to got to and read this
Option Explicit
Sub CloseAllExceptActive_NoSave()
With Application
.ScreenUpdating = False
'Loop Through open documents
Do Until .Documents.Count = 1
'Close no save
.Documents(1).Close SaveChanges:=wdDoNotSaveChanges
Loop
.ScreenUpdating = True
End With
End Sub
The question it came from was about word. Can I just change "Documents" to "Workbooks" to make it work in excel ? Or do I need to alter it at all?
Option Explicit
Sub CloseAllExceptActive_NoSave()
With Application
.ScreenUpdating = False
'Loop Through open documents
Do Until .Documents.Count = 1
'Close no save
.Documents(1).Close SaveChanges:=wdDoNotSaveChanges
Loop
.ScreenUpdating = True
End With
End Sub
The question it came from was about word. Can I just change "Documents" to "Workbooks" to make it work in excel ? Or do I need to alter it at all?