I'm trying to store chart titles in a sheet into an array. I have the following code but it does not seem to work:
ReDim currentArray(1 To .ChartObjects.Count / 3)
For i = 1 To .ChartObjects.Count Step 3
.ChartObjects(i).chart.HasTitle = True
title_name = .ChartObjects(i).chart.ChartTitle.Text
If i = 1 Then
Set currentArray(i) = title_name
Else
Set currentArray((i + 2) / 3) = title_name
End If
Next
It gives me run-time error '424' message saying that object is required on line 6 where I try to store the title_name of the chart into currentArray. What other way is there to store just the chart names and not the charts themselves?