View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Macro Error stops App Macro

Your event macro needs Application.EnableEvents to be set to True for it to
be triggered. Another macro may disable events, do some processing, and then
re-enable events. If the other macro dies before performing the re-enable,
your macro will no longer get triggered.

You need to insure that even if the other macro dies, events get re-enabled.
--
Gary''s Student - gsnu200824


"Steven" wrote:

I have the following code that is run on a right click in the application:

Private Sub App_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As
Range, Cancel As Boolean)
'.....code
End Sub

But if there is an error in a macro from another excel file then this
App_SheetBeforeRightClick does not work and defaults back to the default
right click. Is there a way to make it so an error in a macro from another
excel file will not affect the App_SheetBeforeRightClick macro.

Thank you,

Steven