Just insert the following:Set WBook = ActiveWorkbook before the loop.and then at the endset WBook = nothing