Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    Central Texas, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Twice so far, I've seen cases where an event is used to catch some activity, but the event macro never runs. For the first case, rebooting the computer (or perhaps just exiting/re-entering Excel) fixed it. The second one, I didn't have a chance to follow up on, and I don't know if the problem would happen again if I tried.

    Before rebooting on the first case, I found and tried a function that resets several Excel settings, and it did not help. I seem to recall that exiting and re-entering Excel did not help either, but not certain; it's been several weeks.

    Anyway, my real question is: is there a macro which will reset Excel to default settings, in case a previously-executed macro messed something up, or is there a list available of settings that I can refer to to create such a macro?

    Thanks!

    --Scott.

  2. #2
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Scott,

    I'm not sure that this fully answers your question, but here goes.... In relation to your 'event' subs not running, I would first so a search in your vba modules for "EnableEvents", and ensure that if any of your routines switch this property to false, then it is switched back to true at both the end of each routine and prior to each and every possible exit statement.

    Application.EnableEvents = False
    Application.EnableEvents = True

    At the time that you experience the issue, you could also try entering the line "Application.EnableEvents = True" into the immediate window to see if that corrects it.

    Hope this helps
    Nathan

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by VegasNath View Post
    At the time that you experience the issue, you could also try entering the line "Application.EnableEvents = True" into the immediate window to see if that corrects it.
    I am more inclined to run following line in the immediate window:
    Code:
    "?Application.EnableEvents"
    This approach makes it unnecessary to change anything as part of the troubleshooting -- at least at this point.

    Unless there is interference from auto-run code, the EnableEvents switch will be set to TRUE on launching Excel.
    Regards
    Don

  4. #4
    New Lounger
    Join Date
    Dec 2009
    Location
    Central Texas, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, but EnableEvents did not seem to be the problem; that was the first thing that I checked.

    --Scott.

  5. #5
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Scott McNay View Post
    Sorry, but EnableEvents did not seem to be the problem; that was the first thing that I checked.

    --Scott.
    It might be worth trying Jan Karel Pieterse's Systematic Approach to behavioral Problems in XL.
    Regards
    Don

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you prevent workbook_Open events from running by holding down shift whilst opening the file, all other events are temporarily disabled as well, until you either run a sub or have a UDF that calculates.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •