FreeFile
function to let VBA give you an available file number to use... and you're not closing the files you're opening. Add a Close
instruction before End Sub
. I'd warmly recommend you take a look at Rubberduck, its static code analysis is quickly becoming pretty much flawless =) — Mat's Mug 4 mins ago