+ Reply to Thread
Results 1 to 8 of 8

Overflow on .Top = .Top + x

  1. #1
    Registered User
    Join Date
    04-30-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2003
    Posts
    23

    Overflow on .Top = .Top + x

    Hello guys.

    I'm trying to write some code that would basically:
    1) show the label for one defined point only and hide the labels for all the rest
    2) define how the label should be displayed on the graph

    The problem is I get an "overflow" error at .Top = .Top + 6 and I can't understand why.

    In fact I run the macro once, it works like it should, then when I try to redefine de point I get the "overflow" error. I hit "reset" in the VB Editor, then run the macro again and it works. But still, what's wrong?

    Please Login or Register  to view this content.
    Last edited by Doctorul; 05-17-2009 at 12:41 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,176

    Re: Overflow on .Top = .Top + x

    can you post example workbook with chart and data
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    04-30-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Overflow on .Top = .Top + x

    There you go Andy Pope.

    Just a basic example, a "draft" I'm working on for now.
    Attached Files Attached Files
    Last edited by Doctorul; 05-16-2009 at 03:18 PM.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,176

    Re: Overflow on .Top = .Top + x

    I can not get your example to generate an error.

  5. #5
    Registered User
    Join Date
    04-30-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Overflow on .Top = .Top + x

    Could it be a setting in my Excel?!
    I also noticed that it won't save the position of the label. Each time I open the file, the label is placed to the right no matter what.

    Anyway, thanks a lot Andy Pope. I guess the problem is solved since it can't be reproduced.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,176

    Re: Overflow on .Top = .Top + x

    Maybe not a setting as such but it does sound like your workbook maybe corrupt.

    Is the purpose of the code simply to move the data label nearer to the data point?

  7. #7
    Registered User
    Join Date
    04-30-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Overflow on .Top = .Top + x

    Yes and also to display the data label for one defined point only.

    I'm using some similar code at work where everything is ok, but I've tried improving it at home on my Office 2007 and it's here where the problems apeared.

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,176

    Re: Overflow on .Top = .Top + x

    How about a non vba solution?

    This uses a dummy series that only plots a single point.
    The dummy series name is a combination of the Y values and a Linefeed.

    This allows you to position the data label centered over the data point but because of the 2 lines in the data label the Y value appears above the data marker.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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