Can't Set XValues for Surface Chart




I'm trying to generate a 3D surface plot in VBA. When I
try to assign an address range to the XValues property of
a seriescollection, I get "unable to set the XValues
property of the series class". I am able to set the Name
Property, but not the XValue property.

The sample code snippet:
ActiveChart.ChartType = xlSurface
ActiveChart.SetSourceData Source:=Sheets(sheetName).Range
(chartDataRange _
), PlotBy:=xlColumns


(1).XValues= "=RAW_ping_output!R5C9:R18C9"




Jon Peltier

Jack -

With surface charts, you can do some of these things manually, and even
record a macro while doing it, and then the macro will fail no matter
how you rearrange and cajole the lines. All I've ever been able to do is
reset the entire source data range. You can use a discontiguous range if
you need to omit a row in the middle.

One thing I didn't try is to set all the .Names of all the series, then
change from ByRow to ByColumn (or vice versa), then change all of the
..Names of all the perpendicular series, and finally change back from
ByColumn to ByRow. Let me know if this works.

- Jon
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions

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