+ Reply to Thread
Results 1 to 13 of 13

Series error on a chart

  1. #1
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Series error on a chart

    Hi all,

    I have a bunch of buttons that run macros on charts on a worksheet. When I click on the buttons it is coming up with an error "A chart may only have up to 256 series"

    I know that each chart only has a maximum of 3 series. Does this error mean that I can only have 256 series total on a worksheet? I have 33 charts on the first worksheet and these are populated with 30 buttons gathering data from 30 other worksheets.

    Could this error be resolved by splitting the charts over 2 worksheets to halve the number of series per worksheet?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,803

    Re: Series error on a chart

    2010 should be able to handle 255 data series per chart.

    You say that you know that each chart only has up to 3 series. What does the chart.SeriesCollection.Count return?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    I worked out what is happening but I don't know how to fix it.

    Everytime I press a button it is adding a series to the "select data source" when I look at the chart. so after pressing the button many times it brings up the error.

  4. #4
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    And to answer your question. Some of the charts have numbers in the 100s and others have 255.

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Series error on a chart

    So, did you write the code and now want to fix the problem? What is your question exactly?

  6. #6
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    How do I delete the series from the "select data source" of the chart.

    I can't post the code as it has something in it that gets detected as an SQL injection. What ever that is.

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Series error on a chart

    Since you are taking the trouble to ask a question about it, I assume it's not as simple as just deleting the series from the data source dialog. So, what prevents you from changing the data source in the dialog?

  8. #8
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    I could do that but next time I run it the same will eventually happen. This is being produced for "Not quite so bright" excel users.

    I am creating the series using

    Please Login or Register  to view this content.
    There are 30 charts that automatically gather data from their respective sheet. This part was easy. The part I am having trouble with at the moment is when adding limit lines to the chart. Because each chart has different limits I have I think 17 sets of limit lines. Here is a small part of the code (multiply by 30). I had to remove a line (blank line). It just replaced $cell and $cellf with column letters.

    Please Login or Register  to view this content.
    As I have created the series name surely I can then delete it once the chart has been populated or when run again it empties the source data.
    Last edited by Dragondude; 02-24-2020 at 10:23 PM.

  9. #9
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Series error on a chart

    So, now you want to change the code after all?

    You use the NewSeries command. That will create a new series. If you don't want that to happen, then don't use that command.

    It's really hard to troubleshoot your problem without seeing your code or knowing more about your intention. What should the buttons do when the chart already exists? Maybe you simply need to add some code that ends the sub when a certain condition is true.

  10. #10
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    Everytime I press a button it will update the 30 charts with data from 30 worksheets (there are 33 buttons so a lot of code). The "Trending Charts" sheet holds all the charts. Each chart shows the last 15 entries on each sheet so if there have been any new entries the points on the chart wil shuffle down/along or what ever you want to call it. I created the charts by running "record macro" 30 times and the charts themselves work fine.

    When I wanted to add limit lines I needed (as told by someone else on here) to create a news series which I did, and it worked, until I ran it 255 times. I have now removed the create new series line and it works so long as I don't remove the series from the Series Data source window.

    If this forum didn't spit the dummy everytime I tried to post the code then I would. I will try and upload one buttons worth in a text file.

    The first 2 charts have 2 limit lines

    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    all the others only have

    Please Login or Register  to view this content.
    PS. I never said I didn't want to change the code I was just after solutions to the problem.
    Attached Files Attached Files
    Last edited by Dragondude; 02-25-2020 at 06:35 PM.

  11. #11
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    While trying to solve part of the above problem I have come up with this so far. Problem is it doesn't quite work. If it finds a series exists it works and skips the new series but if the series doesn't exist it still steps over the code and it doesn't create the new series.

    The blank lines are the lines that I can't up load.

    Also in the first line i have .Activate. Is there a difference between Activate and Select?


    Please Login or Register  to view this content.
    Last edited by Dragondude; 02-27-2020 at 12:05 AM.

  12. #12
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    I have worked out what the problem is sort of. The first line was hiding the problem.

    The Set Ser2 = line fails on the first chart without a series (2) if I comment out the on error line.

    The If Ser2 Is Nothing Then line always returns nothing even if the series exists. It never creates a new series, it skips over that line.

    I am lost, it seems simple but I can't seem to find a solution online.

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    11-29-2018
    Location
    Sunny Cairns, QLD AUST
    MS-Off Ver
    2010
    Posts
    97

    Re: Series error on a chart

    Ok. I have no idea why my brain is working on a Friday but I was right. Very simple.....

    Please Login or Register  to view this content.
    Now I just need to work out my array problem. I will start a new thread for that one.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-19-2017, 07:52 PM
  2. Delete Pivto Chart Series when certain word/text is found in the Series Name
    By trizzo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2016, 03:19 PM
  3. Runtime Error 1004 in older Excel Versions when updating Chart Series
    By brokenbiscuits in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2015, 08:01 AM
  4. Replies: 1
    Last Post: 08-05-2014, 05:03 AM
  5. Chart front-to-back series display if series are different chart types
    By Exconomist in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-06-2012, 06:49 AM
  6. Replies: 2
    Last Post: 06-15-2012, 07:28 AM
  7. How to I incorporate SD from a data series into chart error bars?
    By carlosPharm.D in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-02-2005, 05:05 PM

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