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
- 2954 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago