View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default OLEObjects clickable?

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.

--

Vasant

"Erich Neuwirth" wrote in message
...
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