LOST! macro works in xls, not in xla !? losing sanity...!!!


Posted by Chuck on January 18, 2002 1:18 AM

I have a macro that is called by the workbook before_right_click event. It works perfectly in the .xls, but not at ALL in the .xla. NO CLUE what's wrong. I've done xla's before - can't figure this one out.

Thanks in advance...

Posted by Ivan F Moala on January 18, 2002 2:30 AM

In your addin create a classs module
and paste this code in;

Public WithEvents App As Application

Private Sub App_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
MsgBox "text"
End Sub


Obviuosly change the code to suit.


HTH


Ivan



Posted by Aron on January 19, 2002 1:53 PM

I put the following code in a new Class Module:

Public WithEvents App As Application

Private Sub App_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
MsgBox "Success!", vbExclamation
Call enablepaste
End Sub

...and it still won't capture.