Yes, an image was pasted while the macro was running.

I just tried the macro again on the next document, and it's working fine again ...