Capturing an MS Office autoshape click event
I think the answer to this question might be that it's impossible, but I'd like to have this confirmed by experts on the subject (of which I sadly am not...)
I have made a set of macros in Excel which work by assigning code-generated macros to autoshapes so that the macros will execute when the shapes are clicked by the user. I have got some good feedback with regards to the usefulness of what I have made and now I am thinking of making this into an add-in using VS.
I got some way down the road, but I am finding myself stuck because I can not capture a click, or for that matter any other, event on an autoshape within Excel... That means that I have to generate all the 开发者_开发知识库code as text in my add-in, add it as a module to the worksheet, assign the macros to the autoshapes and also make sure that the autoshape-specific object classes are in the worksheet class modules... Basically it takes away the whole point of making an add-in.
My question is: Is there any way to at all to capture a click event on an autoshape in Excel? I haven't tried any other Office apps, but I'm very interested in taking this further into Powerpoint. Would it be possible to capture click event in Powerpoint?
I should add that I have been making the add-in in VS express using a cobbled together template I found on the net, which unfortunately is quite slow. And I have been targetting Office 2003... I am not in a position to try this out with newer versions of Office yet, but might it be possible to capture those events in newer versions of Office?
Any insight or comment would be most welcome.
i'm afraid there is no event exposed by the Shapes in Excel.
This point was confirmed by an Excel MVP in this thread.
Regards,
Max
精彩评论