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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
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
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,478
Members
448,967
Latest member
visheshkotha

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
Back
Top