S
SysMod
So, in this chart I create datalabels and then I want them pushed far left to
the axis, so I get .left and .top and set .left to 0.
However, sometimes, .left gives me
Err -2147467259 Method 'Left' of object 'DataLabel' failed
and the return value is -1#.IND (ie Not a Number)
Some googling in MS finds a note in SP2 that
"The Trendline.DataLabel.Top and Trendline.DataLabel.Left properties of a
chart return the incorrect values if the chart has not been rendered. "
And in fact if I halt in the debugger, and check the .left, it's OK.
So I tried a retry loop using doevents and application.wait and sometimes
that works once and sometimes not.
So, how do I make sure a chart is rendered?
Is there a repaint method, a .ready property I could test and wait for, or
what?
Little point in MS telling us this can happen "if the chart has not been
rendered" without telling us how we can know when it is.
TIA
Patrick
the axis, so I get .left and .top and set .left to 0.
However, sometimes, .left gives me
Err -2147467259 Method 'Left' of object 'DataLabel' failed
and the return value is -1#.IND (ie Not a Number)
Some googling in MS finds a note in SP2 that
"The Trendline.DataLabel.Top and Trendline.DataLabel.Left properties of a
chart return the incorrect values if the chart has not been rendered. "
And in fact if I halt in the debugger, and check the .left, it's OK.
So I tried a retry loop using doevents and application.wait and sometimes
that works once and sometimes not.
So, how do I make sure a chart is rendered?
Is there a repaint method, a .ready property I could test and wait for, or
what?
Little point in MS telling us this can happen "if the chart has not been
rendered" without telling us how we can know when it is.
TIA
Patrick