The macro below was created to update images used in a bubble chart. Sheet "NTA Chart" contains the bubble chart and sheet "Pie Charts" contains the pie charts that are used as images over the bubbles. Distributor is name of the data points, and one pie relates to one data point.
I am now receiving error "Run-time error -2147417848 (80010108) - Method 'Offset' of object 'Range' failed." When I try to debug the line "strDistributor = chtTemp.TopLeftCell.Offset (-1)" is highlighted. This was designed in Excel 2003, but I am now using Excel 2010.
Option Explicit
Sub MakePieMarker()
Dim chtMain As Chart
Dim chtTemp As ChartObject
Dim strDistributor As String
Dim lngSeries As Long
Set chtMain = ActiveWorkbook.Charts("NTA Chart")
With ActiveWorkbook.Worksheets("Pie Charts")
For Each chtTemp In .ChartObjects
strDistributor = chtTemp.TopLeftCell.Offset(-1)
lngSeries = CLng(Mid(strDistributor, 12))
chtTemp.CopyPicture xlScreen, xlPicture
chtMain.SeriesCollection(lngSeries).Paste
Next
End With
End Sub