ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Can't Set XValues for Surface Chart (https://www.excelbanter.com/charts-charting-excel/19122-cant-set-xvalues-surface-chart.html)

Jack

Can't Set XValues for Surface Chart
 
Hi

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:
=============================
Charts.Add
ActiveChart.ChartType = xlSurface
ActiveChart.SetSourceData Source:=Sheets(sheetName).Range
(chartDataRange _
), PlotBy:=xlColumns

ActiveChart.ChartArea.Select

ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection
(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
http://PeltierTech.com/
_______

Jack wrote:

Hi

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:
=============================
Charts.Add
ActiveChart.ChartType = xlSurface
ActiveChart.SetSourceData Source:=Sheets(sheetName).Range
(chartDataRange _
), PlotBy:=xlColumns

ActiveChart.ChartArea.Select

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

===============================



All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com