I have had issues in the past when saving and moving pictures where there is a delay using the clipboard etc...
So where we have:
myPic.Copy
DoEvents
DoEvents
The double DoEvents can still cause the errors from time to time with the copy/ paste' so I would lean towards error handling for it as below:
Do
On Error Resume Next
myPic.Copy
If Err.Number = 0 Then Exit Do
DoEvents
Loop
On Error GoTo 0
Do
On Error Resume Next
tempChartObj.Chart.Paste
If Err.Number = 0 Then Exit Do
DoEvents
Loop
On Error GoTo 0
It's not ideal but I have found it to be more reliable than the double DoEvents.
@jolivanes
I see the note about the merged cells - I completely agree however I do use them for instances like this one. I will always avoid them on data or anything for that matter that could be analysed at a later date. When building something that is just to be printed or is just for looks then I will use merging as I suppose this is what I deem it is for. It makes sizing the image in this instance easier to code.
Happy coding people,
George