title: Excel VBA - Copy a chart and paste as an enhanced metafile
body: <p>I'm trying to copy Chart1 that is an object in Book1 Sheet1 and paste it as an enhanced metafile picture in Book2 Sheet1. I got this code from another site, but it doesn't work:</p>
  
  <pre><code>'Book1 and Book2 previously declared as Workbooks and set
  Book1.Sheets(1).ChartObjects(1).CopyPicture
  Book2.Sheets(1).Range("B3").Paste
  </code></pre>
  
  <p>I get Run-time error 438: "Object doesn't support this property or method"</p>
  
  <p>I would use <a href="https://stackoverflow.com/questions/13327420/vba-excel-paste-chart-as-a-picture">something like this</a>, but their code references the chart location and I would like to go by the chart number if possible.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I have revised my code to the following:</p>
  
  <pre><code>'Sheet1 and Sheet2 declared and set as Worksheets
  Sheet1.ChartObjects(1).Chart.CopyPicture
  Sheet2.PasteSpecial Format:="Picture (Enhanced Metafile)", _
      Link:=False, DisplayAsIcon:=False
  With Sheet2.Shapes(Sheet2.Shapes.Count)
      .Top = Sheet2.Range("B3").Top
      .Left = Sheet2.Range("B3").Left
  End With
  </code></pre>
  
  <p>however it now returns Run-time Error 1004: "Method 'PasteSpecial' of object '_Worksheet' failed".</p>