ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Monitoring application-level event problem (https://www.excelbanter.com/excel-programming/286895-monitoring-application-level-event-problem.html)

R Avery

Monitoring application-level event problem
 
I am working on a project, and for inspiration I am using Walkenbach's
utility (from Excel 2002 power programming with VBA)... I have dumped all of
the code to a .XLA, which i load. It works perfectly, except when I run
other macros (e.g., from my Personal.xls) and use CTRL-Break to stop the
macro. After that point, even though the XL object still exists, and it
works normally (tested using the immediate window), no application-level
events work.

This occurs even if I set XL = nothing and then set it back to the
excel.application or thisworkbook.parent.

Does interrupting a macro (and then ending it) do something to the current
Excel instance which prevents all future events from firing?



Dave Peterson[_3_]

Monitoring application-level event problem
 
You could have been in the middle of code that had set application.enableevents
= false. So excel won't be monitoring any events.

But my real guess is that by clicking on the End statement, you've reset all the
variables in that workbook. Including your class module's. Try running your
workbook_open (?) event to see if that helps.

If it does, you'll either have to add more error checking to stop the blowing up
of your code or some kind of error handler.



R Avery wrote:

I am working on a project, and for inspiration I am using Walkenbach's
utility (from Excel 2002 power programming with VBA)... I have dumped all of
the code to a .XLA, which i load. It works perfectly, except when I run
other macros (e.g., from my Personal.xls) and use CTRL-Break to stop the
macro. After that point, even though the XL object still exists, and it
works normally (tested using the immediate window), no application-level
events work.

This occurs even if I set XL = nothing and then set it back to the
excel.application or thisworkbook.parent.

Does interrupting a macro (and then ending it) do something to the current
Excel instance which prevents all future events from firing?


--

Dave Peterson


R Avery

Monitoring application-level event problem
 
I'll try. Thanks.



"Dave Peterson" wrote in message
...
You could have been in the middle of code that had set

application.enableevents
= false. So excel won't be monitoring any events.

But my real guess is that by clicking on the End statement, you've reset

all the
variables in that workbook. Including your class module's. Try running

your
workbook_open (?) event to see if that helps.

If it does, you'll either have to add more error checking to stop the

blowing up
of your code or some kind of error handler.



R Avery wrote:

I am working on a project, and for inspiration I am using Walkenbach's
utility (from Excel 2002 power programming with VBA)... I have dumped

all of
the code to a .XLA, which i load. It works perfectly, except when I run
other macros (e.g., from my Personal.xls) and use CTRL-Break to stop the
macro. After that point, even though the XL object still exists, and it
works normally (tested using the immediate window), no application-level
events work.

This occurs even if I set XL = nothing and then set it back to the
excel.application or thisworkbook.parent.

Does interrupting a macro (and then ending it) do something to the

current
Excel instance which prevents all future events from firing?


--

Dave Peterson





All times are GMT +1. The time now is 01:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com