Hi Guys,
I am trying to assign number of charts on a worksheet into an array of Chartobject
My code is:
Dim Source() As ChartObject
ReDim Source(ChartCount)
For i = 1 To ChartCount
Set Source(i) = ActiveSheet.ChartObjects(i)
Debug.Print Source(i).Name
next i
This seems to work and i get an output in debug of its names.
my problem comes when i am trying to get the individual charts out of this array
Dim c1, c2 As ChartObject
Set c1 = Source(1)
Set c2 = Source(2)
when i run this, i get a null value back. Can someone please help me out here?
Thanks
BPAT
I am trying to assign number of charts on a worksheet into an array of Chartobject
My code is:
Dim Source() As ChartObject
ReDim Source(ChartCount)
For i = 1 To ChartCount
Set Source(i) = ActiveSheet.ChartObjects(i)
Debug.Print Source(i).Name
next i
This seems to work and i get an output in debug of its names.
my problem comes when i am trying to get the individual charts out of this array
Dim c1, c2 As ChartObject
Set c1 = Source(1)
Set c2 = Source(2)
when i run this, i get a null value back. Can someone please help me out here?
Thanks
BPAT