Madara
New Member
- Joined
- Jan 6, 2015
- Messages
- 13
Hi.
I'm trying to work out this chart tutorial made available here.
alesandrab.wordpress.com
You can download my working file from this link.
https://file.io/3ByKoHsnXLDT
I just couldn't figure out the reason why this does not work. Maybe the VBA code is too old??
When i run it i get "Run-time error '1004': Application-defined or object-defined error
I'm trying to work out this chart tutorial made available here.

Combination Line & Pie Chart
Way back in February of 2013, I published a how to guide on how to create a world map pie chart using vba and Excel. Although I wrote the how to, the original work was of course done by Andy Pope. …
You can download my working file from this link.
https://file.io/3ByKoHsnXLDT
I just couldn't figure out the reason why this does not work. Maybe the VBA code is too old??
VBA Code:
Sub PieMarkers()
Dim chtMarker As Chart
Dim chtMain As Chart
Dim intPoint As Integer
Dim rngRow As Range
Dim lngPointIndex As Long
Application.ScreenUpdating = False
Set chtMarker = ActiveSheet.ChartObjects(“chtMarker”).Chart
Set chtMain = ActiveSheet.ChartObjects(“chtMain”).Chart
Set chtMain = ActiveSheet.ChartObjects(“chtMain”).Chart
Set rngRow = Range(ThisWorkbook.Names(“PieChartValues”).RefersTo)
For Each rngRow In Range(“PieChartValues”).Rows
chtMarker.SeriesCollection(1).Values = rngRow
chtMarker.Parent.CopyPicture xlScreen, xlPicture
lngPointIndex = lngPointIndex + 1
chtMain.SeriesCollection(1).Points(lngPointIndex).Paste
Next
lngPointIndex = 0
Application.ScreenUpdating = True
End Sub
When i run it i get "Run-time error '1004': Application-defined or object-defined error