Event Handlers

raphoe

New Member
Joined
Mar 4, 2004
Messages
3
I have an excel application called Wages, I have coded some of the ThisWorkbook event handlers for this application. My problem is that when another excel workbook is opened, the event handlers in Wages are triggered, sometimes causing a crash. Is there any way to stop the events in Wages being triggered by other excel applications.

Raphoe
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
Hi welcome to the board

Try something like this. at the begging of each event put

if activeworkbook.name = thisworkbook.name then
event code here
else
end if

This way the code will only execute if your workbook is active, if another workbook is active it will not execute.

Hope this helps

Jacob
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,102
Messages
5,768,102
Members
425,454
Latest member
khoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top