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.
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.
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
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.
Are you using 2007?
Yes, Excel 2007 ...
I don't have 2007 installed anywhere as I hated it. What properties are available to you for Point?
I'm not its greatest fan myself ... ! See attached list of properties:
Attachment 659744
That attachment doesn't appear to be valid.
Oh dear ... I click on it and it shows the JPG file that I uploaded ... will try again this eve.
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
Any reason why you can not use the chart select event to capture what is selected?
Please Login or Register to view this content.
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?
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.
Thanks Rory and Andy, mission accomplished
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks