Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close all inactive workbooks without saving
Hi,
Anyone knows how close all inactive workbooks without saving and thus having just one workbeek (the active)?! Thnx |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close all inactive workbooks without saving
Hello
Dim wWorkb As Workbook For Each wWorkb In Application.Workbooks If wWorkb.Name < ActiveWorkbook.Name Then wWorkb.Close (False) Next wWorkb HTH Cordially Pascal "Basta1980" a écrit dans le message de news: ... Hi, Anyone knows how close all inactive workbooks without saving and thus having just one workbeek (the active)?! Thnx |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close all inactive workbooks without saving
This should work:
Sub CloseAll() Dim WkbkName As Object On Error GoTo Close_Error For Each WkbkName In Application.Workbooks() If WkbkName.Name < ThisWorkbook.Name Then WkbkName.Close savechanges:=False Next Close_Error: Resume Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
close w/o saving | Excel Worksheet Functions | |||
why do all excel worksheets/workbooks close when I close one? | Excel Discussion (Misc queries) | |||
Close excel when inactive | Excel Programming | |||
Option in Excel to save a close a workbook inactive for 5 minutes | Excel Discussion (Misc queries) | |||
Inactive close | Excel Programming |