XLA routines: EE_CloseOtherWorkbooks

Routine to close other workbooks
- this saves setting variables and tracking open workbooks
Sub EE_CloseOtherWorkbooks(wbKeepOpen As Workbook) 'http://excelexperts.com/xla-routines-eeCloseOtherWorkbooks for updates on this sub routine ' closes workbooks other than the workbook containing the code and another one specified Dim wbk As Workbook On Error Resume Next For Each wbk In Application.Workbooks If wbk.Name <> ThisWorkbook.Name Then If Not wbKeepOpen Is Nothing Then If wbk.Name <> wbKeepOpen.Name Then wbk.Close (False) End If End If End If Next End Sub
»
- Nick's blog
- Login or register to post comments
- 3023 reads
Recent comments
5 years 50 weeks ago
6 years 36 weeks ago
6 years 48 weeks ago
6 years 51 weeks ago
7 years 1 day ago
7 years 5 weeks ago
7 years 13 weeks ago
7 years 14 weeks ago
7 years 14 weeks ago
7 years 14 weeks ago