• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Can I used Application.EnableEvents throught entire module

ThrottleWorks

Excel Ninja
Hi,

I am editing a code. This code has 'Application.EnableEvents = False' line before opening any workbook. This line is set to True once the workbook is opened.

My doubt is, can I use this line at the start of the module itself ?
And I will set it to True at the end of module.

Like, I set screen updating and display alerts to False at the start of the module and revert at end.

Will doing same thing for Application.EnableEvents have any adverse impact, or will it create any bug in my code ?

Can anyone please help me in this.
 
It depends. If your code needs events to run, then you shouldn't turn them off. If it doesn't, then turning them off is fine, as long as you ensure they will always be reset.
 
Hi @Debaser thanks a lot for the help. In my case there are not any 'Events' as such in code.

Please correct if I am wrong, my assumption of events is code will be executed if 'workbook open' or 'worksheet select' or 'cell select' is triggered. I do not have any such even oriented coding.

Have a nice weekend. :)
 
Back
Top