title: Paste method of Chart object not working as expected in Excel 2016
body: <p>I have a code, recently updated to Excel 2016 that has shown some strange malfunctions. After quite a lot of debugging, I found that one of the errors were caused by Excel failing to handle a image correctly.</p>
  
  <p>The code below has a simple purpose, to copy a used part of a worksheet to an image, and then insert that image as a comment in a worksheet.</p>
  
  <p>However, in order for the function to work properly in Excel 2016, I need to repeat the paste operation several times as you can see in the code.</p>
  
  <p>The workaround is functional, but I believe that some degree of understanding of why is needed, and I would also prefer a more clean solution.</p>
  
  <pre><code>Public Sub CopySheetToComment(ReferenceSheet As Worksheet, Target As Range)
  
  Dim rng As Range
  Dim Sh As Shape
  
  Dim pWidth As Single
  Dim PHeight As Single
  Dim cmt As Comment
  
  Dim TempPicFile As String
  Application.ScreenUpdating = True
  
  ' Path temporary file
  TempPicFile = Environ("temp") &amp; "\img.png"
  
  ' Define and copy relevant area
  Set rng = ReferenceSheet.UsedRange
  rng.CopyPicture Appearance:=xlScreen, Format:=xlPicture
  
  pWidth = rng.Width
  PHeight = rng.Height
  
  ' Paste copied image to chart and then export to file
  Dim C As Object
  Set C = ReferenceSheet.Parent.Charts.add
  Dim Ch As ChartObject
  Set Ch = C.ChartObjects.add(Left:=rng.Left, Top:=rng.Top, Width:=rng.Width, Height:=rng.Height)
  
  ' Ugly solution that is working in Excel 2016....
  Ch.Chart.Paste
  DoEvents
  Ch.Chart.Paste
  DoEvents
  Ch.Chart.Paste
  Ch.Chart.Export TempPicFile
  
  
  ' Remove chart object
  Dim Alerts As Boolean
  Alerts = Application.DisplayAlerts
  Application.DisplayAlerts = False
  C.Delete
  Application.DisplayAlerts = Alerts
  
  ' Remove old comment
  On Error Resume Next
  Target.Comment.Delete
  On Error GoTo 0
  
  Application.ScreenUpdating = True
  ' Add comment
  Set cmt = Target.AddComment
  Target.Comment.Visible = True
  
  ' Infoga bild till kommentar
  With cmt.Shape
      .Fill.UserPicture TempPicFile
      .Width = pWidth * 1.33333
      .Height = PHeight * 1.33333
  End With
  'Target.Comment.visible = False
  
  End Sub
  </code></pre>
  
  <p>And to call it, this example works:</p>
  
  <pre><code>Sub test()
  
  Dim ws As Worksheet
  Set ws = ActiveWorkbook.Worksheets("blad2")
  CopySheetToComment ws, Range("D8")
  
  End Sub
  </code></pre>
  
  <p>Theories on why this works but not DoEvents, or suggestions for proper code is requested.</p>