Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

Trouble getting any event to fire in Exccel 2007

I debugged my database code inside an event that starts with:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

and all was fine. I was getting ready for my first source code check-in and must have deleted something on the Excel document because that event is not longer firing.

It was working anytime I moved the mouse on Sheet2.

Any idea how to get it wokring again??

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sometimes, while debugging, we stop code execution when the code as executed:

    Application.EnableEvents = False

but has not yet executed:

    Application.EnableEvents = True

This leaves the application environment in a state we do not normally want.

Kevin
Avatar of curiouswebster

ASKER

Where is the  Immediate window in 2007?
Press ALT+F11 to switch to the VBE. Press CTRL+G to open the Immediate window.

Kevin
Also, make sure macros are enabled when the workbook is opened.

Kevin
Do I simply need to paste in "Application.EnableEvents = True"?

Do I need to execute it?

Yes.

And make sure macros are enabled.

Kevin
Or you can just quit and restart Excel.

Kevin
>   Yes.

Yes, what?

Do I need to execute it and how do I do so? Or is pasting it sufficient?
In the Immediate window type:

    Application.EnableEvents = True

and press ENTER.

Kevin
Thanks!