Microsoft Excel

Ron de Bruin
Excel Automation

Microsoft MVP Program

Paste Chart as Picture on sheet

In Windows you can use this to make a picture of the activechart and paste it on the sheet

TheChart.CopyPicture Appearance:=xlPrinter, Size:=xlScreen, Format:=xlPicture
ActiveSheet.Paste


If you use the same code on a Mac it will paste the chart and not a picture of it.
You can use the code below to avoid this problem, and it will work in Windows also.

Sub MakePictureChart()
'Working in Windows and on a Mac
'It will past the picture almost on top of the active chart
    Dim TheChart As Chart

    If ActiveChart Is Nothing Then
        MsgBox "Select a chart first please.", vbInformation, "Make Picture of Chart"
        Exit Sub
    End If
    Set TheChart = ActiveChart
    TheChart.CopyPicture Appearance:=xlPrinter, Size:=xlScreen, Format:=xlPicture
    ActiveCell.Select
    ActiveSheet.PasteSpecial Format:="Picture", Link:=False

    With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
        .Left = TheChart.Parent.Left + 16
        .Top = TheChart.Parent.Top + 16
    End With
End Sub