OLEObjects clickable?

E

Erich Neuwirth

I am working with an OLEObject on a worksheet.

Dim myGraphWrapper As OLEObject

an then later

Set myGraphWrapper = ActiveSheet.OLEObjects.Add(_
ClassType:="StatConnControls.GraphicsDevice", _
Link:=False, DisplayAsIcon:=False, _
Left:=181.5, Top:=65.25, _
Width:=256.5, Height:=204.75)


I would like to write a macro which should be run when the object is
richt-clicked.

I do not manage.

Dim WithEvents myGraphWrapper As OLEObject

makes the object unfunctional.
If I do not do that,

myGrapWrapper_GotFocus()

is not executed at all.

What is the idiom to achieve what I need,
an OLEObject reacting to mouse clicks.

Erich Neuwirth
 
V

Vasant Nanavati

OLEObjects don't have a trappable right-click event. You may be able to use
the MouseDown event instead as it provides a Button parameter.
 

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