PDA

View Full Version : Solved: Double Click Event for Shapes



stranno
02-24-2013, 02:12 PM
Hello,

Is there something like a double click event for shapes.I have a sheet that contains more than 1000 shapes. By clicking twice on a shape, a procedure should start. Untill now i made use of:
- myShapeObj.OnAction = "procedure" and
- ActiveSheet.Shapes(Application.Caller), but this fires the procedure with only one
click on a shape, and thats not what i want this time. Any help is appreciated.
Thanks in advance

Stranno

p45cal
02-24-2013, 06:27 PM
I think that's difficult or impossible with Autoshapes, but if the shapes are simple shapes they could be swapped for another control type which has events (such as an ActiveX Label) by a run-once macro, then it's not too difficult to assign any number of these to a collection and they will all respond to a doubleclick by running a single sub in the class module. John Walkenbach does this here (http://j-walk.com/ss/excel/tips/tip44.htm) but this can be adapted to work in a similar way with labels on a sheet.

Double-clicking on any of the three coloured Labels (they look like shapes) in the attached results in calling the same code but recognises which Label has been double-clicked.

stranno
02-25-2013, 10:46 AM
In fact the shapes are charts. No simple shapes i am afraid. Nevertheless thanks for your response.

p45cal
02-25-2013, 11:03 AM
In fact the shapes are charts. No simple shapes i am afraid. Nevertheless thanks for your response.1000 charts! Wow! But that's good news, 'cos if they're full bown charts, they can have events in the same way as Labels had in the last attachment. I'll put together some code for a few charts later on tonight.

p45cal
02-25-2013, 12:06 PM
Just added the chart double-click event to the embedded charts in the attached.

stranno
02-25-2013, 02:07 PM
Hi P45cal, Thank you very much. It seems that i first have to write something before i can open the attachement. I Will soon let you know if it works for me.
Stranno

stranno
02-25-2013, 02:24 PM
Hi P45cal,

Yep, Problem solved. It works like a charm. Thanks again.

Stranno

diogoakira
05-13-2013, 12:14 PM
I really want to see your answer. And for that I have to post something.

diogoakira
05-13-2013, 12:16 PM
I Loved it, thank you!!

tttester
03-20-2014, 01:51 AM
I really want to see your answer. And for that I have to post something.me too.Many thanks

test_fond
05-27-2015, 01:24 AM
will check!

heru1990
09-14-2015, 12:41 PM
great

sagibeli
12-14-2015, 12:54 AM
thanks

sontheimerm
08-29-2016, 04:37 AM
thank you!

FloaTOR
01-17-2017, 06:39 PM
Thank you, looks hopeful !

d.b
03-16-2018, 04:16 PM
Just added the chart double-click event to the embedded charts in the attached.

Excel-lent :)

stranno
03-17-2018, 02:31 AM
:yes

Excel-lent :)