Why does changing chart color cause runtime error?

I'm struggling with the following problem for hours.
It seems changing the color of a chart ( code controlled) causes a runtime error

I broke my code down to a simple example and it turned out it is working until
the marked part of the code is activated.

As soon as the marked line is activated , the runtime error above occurs.

Can anybody check it and advice, please?

Thank you.

SP_new_F_MS_error(1).aia (213.9 KB)

Try clearing the chart first:

image

Thanks, that seems to fix the problem. But why?

But I noticed , clearing the chart in advance, causes more flicker in case of longer charts.

1 Like