Xvalues Property refuses to be set

A

altozar

Hello!

I am developing some code to build a 3D surface chart, the followin
code works:

ActiveSheet.ChartObjects.Add(1, 1, 500, 500).Select
ActiveChart.SetSourceData Source:=ActiveSheet.Range("C39:G42")
ActiveChart.ChartType = xlSurface

However when I add the line
ActiveChart.SeriesCollection(1).XValues = "=Corn!R39C2:R42C2"
to populate one of the Axis, it says "Unable to set the XValue
property of the Series class".

I have tried using a Range("X1:X2") format instead but the sam
problem.

Please help if you can, the data for B38-G42 is
0.8 0.85 0.9 0.95 1
0.8 7,089,147 7,990,164 7,447,518 3,240,783 -1,128,465
0.9 2,928,218 3,714,633 2,376,270 1,012,109 -3,475,953
1 922,604 -3,312,387 -2,548,436 -616,707 -2,752,367
1.1 1,028,430 -8,366,436 -11,144,601 -5,652,855 -7,943,130

Any advice would be much appreciated!!
Than
 
J

Jon Peltier

Try assigning the XValues before defining the chart type. Sometimes it
doesn't matter, and sometimes it causes problems.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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