Hi JP,
Thanks for replying,
I tried your code, the original code kept the activeworkbook open but closed "OTHERWORKBOOK.XLSM". Apparently the code only takes into account the first workbook only in the line,
Case UCase$ (ActiveWorkbook.Name), "OTHERWORKBOOK.XLSM"
So I edited the code like shown below, and now it works.
Function CloseAll()
Dim wkbk As Workbook
Application.ScreenUpdating = False
For Each wkbk In Application.Workbooks
Select Case UCase$ (Workbooks(2).Name)
Case UCase$ (ActiveWorkbook.Name)
Case Else
wkbk.Close savechanges:=False
End Select
Next wkbk
End Function
Thank you very much JP for pointing me in the right direction.
Bookmarks