VBA Stops Working

E

egun

I have a workbook in which I rely on the Worksheet_Change routine to monitor
user edits. Every once in a while, when I'm working in my edit-test-fix
cycle, the VBA will simply stop responding. I make a change to the
worksheeet that should trigger the code, and nothing happens. I set
breakpoints all over the place, but none of them are ever reached. If I
save, quit Excel and restart, the code works again.

I'm worried that I have introduced bad code or a bug that is causing this.
Does anyone know if this is an Excel issue or is it more likely that I have
some bad code that is causing the problem?

Thanks,

Eric
 
E

egun

Jeez, never mind, I figured it out. I'm using Application.EnableEvents =
False (and later True) to prevent recursion in the Worksheet_Change routine.
When I stop the code partway through, the events are not turned back on!
That's why the Worksheet_Change event is not triggered afterwards.
 

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