+ Reply to Thread
Results 1 to 14 of 14

How can I determine the index of a Point object within it's parent array?

  1. #1
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    How can I determine the index of a Point object within it's parent array?

    Consider the code below (so simple as to be self-explanatory). The print statement never gets called, despite the outer conditional evaluating to TRUE, which seems odd to me. Any ideas why?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: How can I determine the index of a Point object within it's parent array?

    They return different pointers (you'll see similar behaviour with Range objects) so the Is operator never returns True. You could just use:

    Please Login or Register  to view this content.
    Rory

  3. #3
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How can I determine the index of a Point object within it's parent array?

    Thanks for your answer Rory, but with your code I get the error "Object doesn't support this property or method". And "Name" does not appear in the drop-down list that pops up when I type "pnt." In fact, most of the properties given on Microsoft's documentation page for the Point object do not appear in the list.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: How can I determine the index of a Point object within it's parent array?

    Are you using 2007?

  5. #5
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How can I determine the index of a Point object within it's parent array?

    Yes, Excel 2007 ...

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: How can I determine the index of a Point object within it's parent array?

    I don't have 2007 installed anywhere as I hated it. What properties are available to you for Point?

  7. #7
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How can I determine the index of a Point object within it's parent array?

    I'm not its greatest fan myself ... ! See attached list of properties:
    Attachment 659744

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: How can I determine the index of a Point object within it's parent array?

    That attachment doesn't appear to be valid.

  9. #9
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How can I determine the index of a Point object within it's parent array?

    Oh dear ... I click on it and it shows the JPG file that I uploaded ... will try again this eve.

  10. #10
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How can I determine the index of a Point object within it's parent array?

    Properties of Point in Excel 2007 as follows:

    Application
    ApplyDataLabels
    ApplyPictToEnd
    ApplyPictToFront
    ApplyPictToSides
    ClearFormats
    Copy
    Creator
    DataLabel
    Delete
    Explosion
    Format
    Has3DEffect
    HasDataLabel
    InvertIfNegative
    MarkerBackgroundColor
    MarkerBackgroundColorIndex
    MarkerForegroundColor
    MarkerForegroundColorIndex
    MarkerSize
    MarkerStyle
    Parent
    Paste
    PictureType
    PictureUnit2
    SecondaryPlot
    Select
    Shadow

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

    Re: How can I determine the index of a Point object within it's parent array?

    Any reason why you can not use the chart select event to capture what is selected?

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  12. #12
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How can I determine the index of a Point object within it's parent array?

    That's getting me in the right direction, thank you.

    The function seems only to be called if it is placed within the VB code of the chart on which the select event occurs - e.g. if I want to capture the select event on Chart 6, I have to add the Chart_Select listener to the code for Chart 6.

    Is there a way to bind the listener to selectable objects on all charts?

    I have in mind something like Javascript's element.addEventListener() method. Does excel provide an equivalent mechanism?

  13. #13
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: How can I determine the index of a Point object within it's parent array?

    Define a class with a Chart variable declared WithEvents, and set up the click event as needed. Then in the Workbook_Open event, populate a collection (declared at module level so it persists) with a new instance of the class for each chart in the workbook.

  14. #14
    Registered User
    Join Date
    08-01-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: How can I determine the index of a Point object within it's parent array?

    Thanks Rory and Andy, mission accomplished

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 11-19-2019, 05:28 AM
  2. [SOLVED] Getting parent.name in Array formula...
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2018, 09:51 AM
  3. Determine max value and associated data point
    By zgall1 in forum Excel General
    Replies: 14
    Last Post: 05-08-2017, 03:04 PM
  4. Parent child - object doesn't support this property or method
    By Rajkumarin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2016, 05:48 PM
  5. Using the Parent property of the Borders Object
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2013, 09:53 PM
  6. Determine Point Size of Text - Take 2
    By ben in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2006, 11:10 PM
  7. How to determine the parent directory
    By KS Wong in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-05-2005, 10:06 PM

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