Scattered,
I've tried your suggestions and they have not worked.
Thanks,
Matt
- Show quoted text -
Sorry that they are not working. I am a bit confused - I was sure my
second post would work. I just created a workbook with a scatter chart
in it with x,y values inititialized in some random way. Then I created
2 named ranges. The following code works for me:
Sub Test()
Dim sh As Worksheet
Set sh = ActiveSheet
sh.ChartObjects(1).Activate
ActiveChart.SeriesCollection(1).XValues = "=Book1!Beginning_Timer"
ActiveChart.SeriesCollection(1).Values = "=Book1!Temp_Range"
End Sub
After running it, the chart's xvalues and yvalues point to the right
named range. Perhaps you could post more of your code.
As a suggestion, you could also experiment with eliminating things
like "ActiveChart" from your code. Try something like
Sub Test()
Dim sh As Worksheet
Dim ch As Chart
Dim mySeries As Series
Set sh = ActiveSheet
Set ch = sh.ChartObjects(1).Chart
Set mySeries = ch.SeriesCollection(1)
With mySeries
.XValues = "=Book1!Beginning_Timer"
.Values = "=Book1!Temp_Range"
End With
End Sub
A bit more verbose, but then you can use intellisense to ultimately
save on typing (in a larger program) and more importantly to help you
know if you are using the Excel object model correctly.
hth
-scattered