Error 1004: Unable to set the XValues of the Series Class

J

jonathanmiller

The first 2 times I run this code, it loads the bubble chart perfectly
On the 3rd time I run it, I recieve the error:

Error 1004: Unable to set the XValues of the Series Class


While Range("datastart").Offset(rowoffset, intColNames).Value <
""
intTemp1 = intTemp1 + 1
strXRange = Range("datastart").Offset(rowoffset
intColXValues).Address
strAddr1 = Range("datastart").Offset(rowoffset
intColYValues).Address
strAddr2 = "='Data'!R" & Range("datastart").Offset(rowoffset
intColSize).Row & _
"C"
Range("datastart").Offset(rowoffset, intColSize).Column
With ActiveChart
With .SeriesCollection.NewSeries
.XValues = Sheets("Data").Range(strXRange)
.Values = Sheets("Data").Range(strAddr1)

.Name
safeName(Replace(Range("datastart").Offset(rowoffset, intColNames - 1)
" ", ""))
.BubbleSizes = strAddr2

'add data labels
If Sheets("Data").Range(strXRange).Value <> "N/A" Then
.Points(1).HasDataLabel = True
.Points(1).DataLabel.Text
Range("datastart").Offset(rowoffset, intColNames)
.Points(1).DataLabel.Position
xlLabelPositionCenter
.Points(1).DataLabel.Font.Size = 8.5
End If

.Interior.PatternColorIndex = 19
.Interior.Pattern = xlSolid
.Interior.ColorIndex
CInt(Range("datastart").Offset(rowoffset, colorNum))

.Border.LineStyle = xlNone

End With
End With

'move to next row
rowoffset = rowoffset + 1
Wen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top