How to use Cells property to Range object?
j = 3 'start at column 4
Do While j < lc 'lc = last column
Set objSeries = objChart.SeriesCollection.NewSeries
With objSeries
.Values = objSheet.Range(objSheet.Cells(2, (j + 1)),
objSheet.Cells(lr, j + 1))
.Name = objSheet.Cells(1, (j + 1))
End With
j = j + 1
Loop
The Values property gets set successfully, but subsequent properties throw
an error:
1004 Unable to set the Name property of the Series class
I get the same error with other properties, e.g. ".Border.Weight = xlThin",
etc.
Why can't I set the properties?
|