Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 21
Default Method 'Left' of object 'DataLabel' failed

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

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Method 'Left' of object 'DataLabel' failed

Hi,

There is a Refresh method.
I tested on a xy-scatter with some +14k points and did not get an error when
updating the chart, refreshing and then moving the trendline data label.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"SysMod" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 21
Default Method 'Left' of object 'DataLabel' failed

Thanks, Andy
I've noticed the 'rate' question so I'll go back and mark the previous one
too.

BTW my problem with -1.#IND was a data point that was text, not numeric :-(

All the best,
Patrick


"Andy Pope" wrote:
There is a Refresh method.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method Add of object Validation Failed - please help Shokie New Users to Excel 1 July 10th 09 01:34 PM
Method Add of object Validation Failed - please help Shokie Excel Worksheet Functions 1 July 10th 09 01:33 PM
Method 'MailEnvelope' of object '_Worksheet' failed [email protected] Excel Discussion (Misc queries) 1 December 7th 05 11:20 PM
Method 'Paste' of object '_Worksheet' failed markline Excel Discussion (Misc queries) 7 May 28th 05 05:02 AM


All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"