Solved

Trouble getting any event to fire in Exccel 2007

Posted on 2011-09-08
11
210 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:newbieweb
  • 7
  • 4
11 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
Comment Utility
In the Immediate window type:

    Application.EnableEvents = True

and press ENTER.

Kevin
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
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
0
 

Author Comment

by:newbieweb
Comment Utility
Where is the  Immediate window in 2007?
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
Press ALT+F11 to switch to the VBE. Press CTRL+G to open the Immediate window.

Kevin
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
Also, make sure macros are enabled when the workbook is opened.

Kevin
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:newbieweb
Comment Utility
Do I simply need to paste in "Application.EnableEvents = True"?

Do I need to execute it?

0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
Yes.

And make sure macros are enabled.

Kevin
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
Or you can just quit and restart Excel.

Kevin
0
 

Author Comment

by:newbieweb
Comment Utility
>   Yes.

Yes, what?

Do I need to execute it and how do I do so? Or is pasting it sufficient?
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
In the Immediate window type:

    Application.EnableEvents = True

and press ENTER.

Kevin
0
 

Author Closing Comment

by:newbieweb
Comment Utility
Thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now