View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default How to re-enable events after a VB error in Excel?

Fast and dirty way to reset events quickly is by executing this line of code
in the Immediate Window...

Application.EnableEvents = True

That will handle your stopping the program manually. As for your "if it is
not caught" statement, what do you mean if it is not caught... how is the
error trap set up that it is missing the error?

--
Rick (MVP - Excel)


"ras" wrote in message
...
I have a VB application in Excel (in Office 2007).
If an error occurs, and the error is caught and err.clear executes,
then all is fine.
If it is not caught, or if I stop the function at this point (with the
Reset button),
events no longer trigger event callbacks!

I added a global function that does: Application.EnableEvents = true
When I run this, in the debugger I see it's already true
and running it does nothing.

To re-enable events I have to quit Excel and restart (losing my
breakpoints).
How do I get events to work again?

thx
(I tried to add this to a similar message, but after submitting it
with "reply to author", didn't see my entry. How do I "reply to
thread"? I'm using
http://groups.google.com/group/micro...el.programming
...)