trapping click events on shapes

M

Matt I

I'm trying to trap mouse clicks on a shape that is on a
Worksheet. The SheetBeforeRightClick Event traps mouse
clicks over cells but not over the shape - any suggestions
for a solution?
 
R

Rob Bovey

Matt I said:
I'm trying to trap mouse clicks on a shape that is on a
Worksheet. The SheetBeforeRightClick Event traps mouse
clicks over cells but not over the shape - any suggestions
for a solution?

Hi Matt,

The only way to do this is to assign a macro to the OnAction property of
the shape. This will run the specified macro whenever the user clicks on the
shape. There's no way that I know of to trap a right-click over a shape.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
S

Sandy V

Hi Bob

This problem has also frustrated me, although I only
need "GotFocus".

Would it be possible to "Class" for any object including
shapes on the activesheet and get the GotFocus event. To
compound problems my code is not in the active workbook.

TIA
Sandy
 
R

Rob Bovey

Sandy V said:
Hi Bob

This problem has also frustrated me, although I only
need "GotFocus".

Would it be possible to "Class" for any object including
shapes on the activesheet and get the GotFocus event. To
compound problems my code is not in the active workbook.

Hi Sandy,

The GotFocus event only applies to ActiveX controls and is inherited by
those controls from the Worksheet container object. This means there is no
way to trap the GotFocus event outside the code module of the Worksheet
hosting the control. It can't be trapped at all for other kinds of shapes
because it doesn't apply to shapes that aren't ActiveX controls.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top