Originally Posted by
georgiboy
Perhaps something ...
Thank you. I have modified your code to work on ActiveChart, but I got error on the line
wsT.Cells(r, 1) = .Format.Line.ForeColor:
Sub extract_chart_styles()
Dim it As ChartObject, j As Integer, i As Integer, r As Integer, wsT As Worksheet
Set wsT = Sheets("t")
If TypeName(Selection) <> "ChartArea" Then
MsgBox "Please select ChartArea, not" + TypeName(Selection)
Exit Sub
End If
For j = 1 To ActiveChart.SeriesCollection.Count
r = r + 1
With ActiveChart.SeriesCollection(j)
wsT.Cells(r, 1) = .Format.Line.ForeColor
wsT.Cells(r, 2) = .MarkerStyle
wsT.Cells(r, 3) = .MarkerSize
wsT.Cells(r, 4) = .MarkerForegroundColor
End With
Next
End Sub
It looks like in old Excel the member Format does not exist. However there is a Fill member. So this works when I replace Format.Line to Fill.
extract_chart_styles()
Dim it As ChartObject, j As Integer, i As Integer, r As Integer, wsT As Worksheet
Set wsT = Sheets("t")
If TypeName(Selection) <> "ChartArea" Then
MsgBox "Please select ChartArea, not" + TypeName(Selection)
Exit Sub
End If
For j = 1 To ActiveChart.SeriesCollection.Count
r = r + 1
With ActiveChart.SeriesCollection(j)
wsT.Cells(r, 1) = .Fill.ForeColor
wsT.Cells(r, 2) = .MarkerStyle
wsT.Cells(r, 3) = .MarkerSize
wsT.Cells(r, 4) = .MarkerForegroundColor
End With
Next
End Sub