+ Reply to Thread
Results 1 to 2 of 2

Can't Set XValues for Surface Chart

  1. #1
    Jack
    Guest

    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"

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

  2. #2
    Jon Peltier
    Guest

    Re: Can't Set XValues for Surface Chart

    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"
    >
    > ===============================


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1