Since December 2021, I have been wrestling with an issue. I have a number of programs that copy pictures and ranges and paste them as pictures. I started getting random error messages for either copy or paste. Sometimes the program will run perfectly, sometimes it would fail on a particular record and the next time the copy / paste for that record works fine but it fails on some other record where it previously succeeded.

I have come to the conclusion that what is happening is that the buffers are getting overrun. They are not ready to receive a copy or they are still receiving copy information when the command to paste comes along. Fortunately, this is a relatively uncommon situation. It seems to happen about one out of every 25 times.

The solution I came up with is to use recursion. Basically, if at first you don't succeed, try, try again. Here is the general concept:
Please Login or Register  to view this content.
In my testing, I put a MsgBox between TryAgain: and CopyPicutre. With a one in 25 failure rate, I never noticed more than one reiteration. However if you suspect a higher failure rate, you might want to set a global counter to limit the number of iterations.