louiserace
New Member
- Joined
- Jun 24, 2015
- Messages
- 15
I have written a macro that pastes a chart onto a graph. This worked fine when I was on Excel 2013 but it now crashes in Excel 2016.
The code is as follows:
The error is Run time error '1004': Unable to get the Paste property of the Pictures class.
This occurs on the line that says 'With copiedChart.Pictures.Paste'
This all worked perfectly on Excel 2013 so can anyone help with what I need to change to make it work now.
Thanks
The code is as follows:
Code:
Sub ResultBox(currentRow As Long, copiedChart As Chart)
ResultsTable.[B1] = Data.Range("B" & currentRow)
ResultsTable.[I3:I15].AutoFilter 1, "<>"
ResultsTable.[B3:D15].Copy
copiedChart.Pictures.Select
With copiedChart.Pictures.Paste
.ShapeRange.Left = 112.5
.ShapeRange.Top = 191.0155905512
End With
End Sub
The error is Run time error '1004': Unable to get the Paste property of the Pictures class.
This occurs on the line that says 'With copiedChart.Pictures.Paste'
This all worked perfectly on Excel 2013 so can anyone help with what I need to change to make it work now.
Thanks