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!
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?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks