+ Reply to Thread
Results 1 to 2 of 2

Thread: Find Top and Left values for Shape in Chart

  1. #1
    Registered User
    Join Date
    02-03-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    1

    Find Top and Left values for Shape in Chart

    I am trying to write a short macro that will tell me the top and left values of a shape that I've clicked on within a chart.

    Here is what i have:

    Sub Display_Left_Top_Position()

    Dim Left_Value As Double
    Dim Top_Value As Double

    Left_Value = ActiveChart.Shapes(Application.Caller).Left
    Top_Value = ActiveChart.Shapes(Application.Caller).Top

    MsgBox "Left Value: " & Left_Value & " Top Value: " & Top_Value

    End Sub


    However I get the following error: "The item with the specified name wasn't found". Anyone have any thoughts?

    Thanks!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: Find Top and Left values for Shape in Chart

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    What is the value of Application.Caller? Is it the shape name or perhaps the charts name instead.
    Is the chart actual active when you click the shape?
    Cheers
    Andy
    www.andypope.info

+ 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.2.0