Yes, I have exactly the same problem in some code that I use, although it never pressed enough for me to do what (apparently) I needed to fix.
The problem is described in this Knowledge Base article. The article assumes that:
To resolve this issue, periodically save and close the book while the copying process is in progress.
I note that you said that you “save and open the book when copying”, but I assume that you do this before you run the code, since I do not see any indication of its execution during the loop. One way to do this inside the loop itself:
Implement error handling with
On Error Goto
at an early stage of the procedure; then
Put
Exit Function ErrorHandler:
block below. Inside the error handler itself, you will need to check if Err.Number is 1004. If so, close both the source and target books, then reopen them and resume in the line where the error occurred. It would be nice to keep track of how many calls to the error handler have been made, and just discard a certain number to make sure that you don't end an infinite loop.
This is basically an idea that I had to solve my problem, but I never had the time / need to implement it. I would test it before publishing it, but the files are in the office and I do not have access to them.
I would be interested to see how you go if you decide to go this route.
Another option is the one proposed in the KB article, which consists in closing and reopening a book after n iterations. The problem is that it offers 100 iterations, while mine fails after 32 or 33. (It seems that it depends on the size of the sheet, among other things.) There are also times when mine fails after 10 (with exactly same sheets) and the only way to fix this is to close and reopen Excel. (Obviously, this is not a very large option for VBA-based code.)