+ Reply to Thread
Results 1 to 8 of 8

Application.EnableEvents Changes to False

Hybrid View

Rushti Application.EnableEvents... 11-30-2009, 10:16 AM
DonkeyOte Re: Application.EnableEvents... 11-30-2009, 10:19 AM
Rushti Re: Application.EnableEvents... 11-30-2009, 10:26 AM
DonkeyOte Re: Application.EnableEvents... 11-30-2009, 10:32 AM
Rushti Re: Application.EnableEvents... 11-30-2009, 10:47 AM
Andy Pope Re: Application.EnableEvents... 11-30-2009, 10:49 AM
  1. #1
    Registered User
    Join Date
    11-30-2009
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Application.EnableEvents Changes to False

    Hi,

    I have a workbook which, when I paste into a cell, Application.EnableEvents changes to false.

    I have found this by using the immediate window to print the status of the Application.EnableEvents:

    When my workbook opens, it runs some code, when finished, the Application.EnableEvents = True

    I click any cell on the sheet that is shown - Application.EnableEvents = True

    I copy this cell (either by the ribbon or ctrl + c) Application.EnableEvents = True

    I click another cell - Application.EnableEvents = True

    I paste into this cell - Application.EnableEvents = False

    I have no code that traps a ctrl + v or paste but require the enableevents not to be changed.

    Does anybody have any ideas as to what could be the problem?

    Many Thanks in Advance,

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Application.EnableEvents Changes to False

    Have you checked to see if you have any Sheet object events like Change, Calculate etc firing either at Workbook or Sheet object level ?

  3. #3
    Registered User
    Join Date
    11-30-2009
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Application.EnableEvents Changes to False

    Thanks for the speedy reply

    There is a class module which is used to ungroup sheets on sheet activate and sheetselectionchange.

    This has been turned off while I fix the problem. These work before anything is pasted and leave application.enableevents = true when finished

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Application.EnableEvents Changes to False

    the only thing that will be affecting the Events status is code... an event is firing somewhere ...

    Being a bore... let's check things off:

    a) ThisWorkbook checked and clear of code ?

    b) If a) is yes then... from native XL right click on tab in question and select View Code - is that clear of code ?

    If neither a) nor b) are throwing up code then I would assume the Class Module is the cause... use Immediate window to ensure Events are enabled before doing anything... then with Class Module supposedly out of action repeat the copy & paste ... now check events status again, what is the status ?


    Also be sure that whatever error handlers you have in place are ensuring Events are reset prior to exiting routine...

  5. #5
    Registered User
    Join Date
    11-30-2009
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Application.EnableEvents Changes to False

    ThisWorkbook has code within it the Workbook_Open procedure.

    Once the workbook opens and this code runs Application.EnableEvents = True.

    The worksheet in question has no code in it.

    I have found that it appears not only to be on paste but on any change Application.EnableEvents changes to false

    I have completley removed the class module and any reference to it for the moment. The same problem is there.

    Where should I look now?

    Thanks

  6. #6
    Registered User
    Join Date
    11-30-2009
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Application.EnableEvents Changes to False

    Additionally, If I create a new workbook with my current one open, the same problem happens.

    If I create a new workbook without the other open, there is no problem.

    I hope this helps.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,480

    Re: Application.EnableEvents Changes to False

    You can also use the Watch window to help locate the change.

    Add a watch to, Application.EnableEvents, in all procedures of all modules.
    Break on change.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1