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
- 3045 reads
Recent comments
6 years 3 weeks ago
6 years 41 weeks ago
7 years 6 days ago
7 years 3 weeks ago
7 years 4 weeks ago
7 years 10 weeks ago
7 years 18 weeks ago
7 years 18 weeks ago
7 years 18 weeks ago
7 years 18 weeks ago