• Limit on array as chart series? (Excel 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Limit on array as chart series? (Excel 2000)

    Author
    Topic
    #444219

    I found some useful code recently which claimed to make charts independent of their source data ranges by making the assignment ser.values = ser.values, where ser is a series object. The practical effect of this is that in the SERIES formula for a chart, the cell range (e.g. B2:BA2) is replaced by an array of values (e.g.{1,2,…,52}).

    This has been failing on certain charts with error 1004 unable to assign to series property, and on revisiting this today it seems to me that the problem is with the length of the array.

    I have 52 values in each data series. Where each data point is a 3-digit number, the assignment works. If each data point is a 4-digit number, the assignment fails with the error given. However, I can’t find a specific limitation of Excel that corresponds to this! (e.g. max formula length = 1024 characters, but I can’ t be exceeding 300 in total).

    Can anyone shed any light on which limit I’m exceeding?

    Thanks

    Jeremy

    Viewing 1 reply thread
    Author
    Replies
    • #1073665

      I don’t know what your code is but would guess that you if you are not hitting the 1024 formula length limit, you may be hitting the old 255 character string length limit?

    • #1073713

      I experimented a bit, and I can confirm Rory’s idea. Apparently, the formulas for the values are stored as old-fashioned strings with a maximum length of 255 characters. The code fails as soon as the formula for one of the series exceeds 255 characters.

      • #1073808

        Thanks guys. I did some more testing and reached the same conclusion. Annoyingly, if I have a chart that already has an array of values as the source for one of the data series, if I click on the line and go into the formula bar I can edit the SERIES formula e.g. by adding 1 in front of all the numbers so that the resulting formula DOES exceed the 255 limit, but if I try to record this action the macro recorder doesn’t capture the changes, so I appear to be stuck!

        Jeremy

        • #1073814

          That is correct – in the user interface, you are limited by the 1024 character formula limit. In code, you are stuck with the 255 character limit. You might be better off taking a picture of the charts if that’s an option.

    Viewing 1 reply thread
    Reply To: Limit on array as chart series? (Excel 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: