Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Cannot rename series on chart (2000 SP3)

    I'm struggling to rename the series in a chart. Whilst Excel will construct the chart fine from the cells I select, whenever I go into the source data dialogue to make any alterations, in this case just to rename the series, it truncates the string specifying the location of the values, resulting in an invalid formula (there are only 13 datapoints in a series, but the name of the sheet is long).

    I tried to record a macro changing the name of a series in another chart, and use that syntax to rename the series in vba, but that doesn't work either - this syntax:

    ActiveSheet.ChartObjects(1).SeriesCollection(1).Na me="=""Eggs"

    doesn't work, returning the error "Unable to set the name property of the series class."

    I've worked out that it doesn't seem to work at all as an immediate command, but can get it to work inside a subroutine for other charts, just not this one.

    What's going on? What are the limitations here?

    Thanks

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Cannot rename series on chart (2000 SP3)

    Try changing your sheet name to something shorter, editing the formula, then you can rename the sheet name as desired.

    Steve

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cannot rename series on chart (2000 SP3)

    You must use the Chart property of the ChartObject:

    ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1).Name = "Eggs"

    or

    ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1).Name = "=Sheet1!R3C1"

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    369
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Cannot rename series on chart (2000 SP3)

    Thanks both very much. I'd gone with the Steve option, although it always irks me to have to work around the rubbish limitations of such an expensive piece of software.

    I've tried the updated syntax, Hans, and it still gives me the same error. It's all linked with the original problem in that if I shorten the name of the worksheet I can then rename the series in code (but, of course, I don't need to). Why the length of the values string has anything to do with the name string without having to open the dialogue I don't know, but there's clearly something stopping vba renaming the series.

    At least the workaround worked, annoying as it was to have to do it.

    Thanks

Posting Permissions

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