+ Reply to Thread
Results 1 to 4 of 4

ActiveChart.SeriesCollection(2) problem

  1. #1
    Registered User
    Join Date
    02-20-2009
    Location
    Zurich
    MS-Off Ver
    Excel 2003
    Posts
    3

    ActiveChart.SeriesCollection(2) problem

    I've already defined a Chart with 2 Series and now I want to change the data serie of the graph using the following VBA- code:

    Please Login or Register  to view this content.
    It works perfectly for the 1st Serie but not for the 2nd one (why??), so at line 2 I have the following error message:

    "the XValues-property of Series-Objekt cannot be set"

    What's the problem?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: ActiveChart.SeriesCollection(2) problem

    Does the range for the second series contain cells that are empty or have errors suchs as #N/A or #Value?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-20-2009
    Location
    Zurich
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: ActiveChart.SeriesCollection(2) problem

    No! All the cells in the range R80C11:R82C11 and R80C13:R82C13 are full and in the correct number format!

    But you mentionned an interesting point because I noticed that the "still-not acualised" data range of the 2nd serie under "data source" of the graph is in fact empty (because rows have been previously shifted down and the source data of the graph has also "slipped down" on an empty range: that's actually why I want to re-actualise the data source on the correct cells)

    Could that be the problem? In case yes, what would be the way to pass this issue around??

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: ActiveChart.SeriesCollection(2) problem

    So actually the answer is YES! not No!

    The second series references empty cells, just not the correct cells.

    You can either delete the series and add a new one.
    Or you can change the chart type, I think column chart will work with empty cells, before changing ranges and reseting chart type back.

+ 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