+ Reply to Thread
Results 1 to 6 of 6

Application.EnableEvents ... Is Local or Global ?

  1. #1
    monir
    Guest

    Application.EnableEvents ... Is Local or Global ?

    Hello;

    Book1.xls and Book2.xls, each has few events.
    For editing purposes, if I open Book1 (which has Application.EnableEvents =
    True in its ThisWorkbook Open event module), and then open Book2 (which has
    Application.EnableEvents = False in its ThisWorkbook Open event), ALL events
    in both Book1 and Book2 become disabled !!!

    Is this how it supposed to work ???

    Thank you.

  2. #2
    Chip Pearson
    Guest

    Re: Application.EnableEvents ... Is Local or Global ?

    EnableEvents is an application-wide setting -- it affects all
    event procedures in all open workbook. There is no built-in way
    to enable/disable events for a particular workbook.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com

    "monir" <monir@discussions.microsoft.com> wrote in message
    news:403BDB19-2B09-4F8B-89AA-3D4A7FD1C06D@microsoft.com...
    > Hello;
    >
    > Book1.xls and Book2.xls, each has few events.
    > For editing purposes, if I open Book1 (which has
    > Application.EnableEvents =
    > True in its ThisWorkbook Open event module), and then open
    > Book2 (which has
    > Application.EnableEvents = False in its ThisWorkbook Open
    > event), ALL events
    > in both Book1 and Book2 become disabled !!!
    >
    > Is this how it supposed to work ???
    >
    > Thank you.




  3. #3
    Doug Glancy
    Guest

    Re: Application.EnableEvents ... Is Local or Global ?

    monir,

    Properties of the Application object, such as EnableEventsand
    ScreenUpdating, apply to all of Excel, i.e., they are global.

    hth,

    Doug

    "monir" <monir@discussions.microsoft.com> wrote in message
    news:403BDB19-2B09-4F8B-89AA-3D4A7FD1C06D@microsoft.com...
    > Hello;
    >
    > Book1.xls and Book2.xls, each has few events.
    > For editing purposes, if I open Book1 (which has Application.EnableEvents
    > =
    > True in its ThisWorkbook Open event module), and then open Book2 (which
    > has
    > Application.EnableEvents = False in its ThisWorkbook Open event), ALL
    > events
    > in both Book1 and Book2 become disabled !!!
    >
    > Is this how it supposed to work ???
    >
    > Thank you.




  4. #4
    monir
    Guest

    Re: Application.EnableEvents ... Is Local or Global ?

    Chip & Doug;
    Thank you very much for the clarification.


    "Doug Glancy" wrote:

    > monir,
    >
    > Properties of the Application object, such as EnableEventsand
    > ScreenUpdating, apply to all of Excel, i.e., they are global.
    >
    > hth,
    >
    > Doug
    >
    > "monir" <monir@discussions.microsoft.com> wrote in message
    > news:403BDB19-2B09-4F8B-89AA-3D4A7FD1C06D@microsoft.com...
    > > Hello;
    > >
    > > Book1.xls and Book2.xls, each has few events.
    > > For editing purposes, if I open Book1 (which has Application.EnableEvents
    > > =
    > > True in its ThisWorkbook Open event module), and then open Book2 (which
    > > has
    > > Application.EnableEvents = False in its ThisWorkbook Open event), ALL
    > > events
    > > in both Book1 and Book2 become disabled !!!
    > >
    > > Is this how it supposed to work ???
    > >
    > > Thank you.

    >
    >
    >


  5. #5
    monir
    Guest

    Re: Application.EnableEvents ... Is Local or Global ?

    Now ... If I open Book2 first (which has Application.EnableEvents = False),
    then open Book1 (which has Application.EnableEvents = True), then why ALL
    events in both Book1 & Book2 become also disabled ?

    And, if I move the above Aapplication object from ThisWorkBook open event to
    a Worksheet event, would this make any differenece on how it's treated?

    Thanks again.


    "monir" wrote:

    > Chip & Doug;
    > Thank you very much for the clarification.
    >
    >
    > "Doug Glancy" wrote:
    >
    > > monir,
    > >
    > > Properties of the Application object, such as EnableEventsand
    > > ScreenUpdating, apply to all of Excel, i.e., they are global.
    > >
    > > hth,
    > >
    > > Doug
    > >
    > > "monir" <monir@discussions.microsoft.com> wrote in message
    > > news:403BDB19-2B09-4F8B-89AA-3D4A7FD1C06D@microsoft.com...
    > > > Hello;
    > > >
    > > > Book1.xls and Book2.xls, each has few events.
    > > > For editing purposes, if I open Book1 (which has Application.EnableEvents
    > > > =
    > > > True in its ThisWorkbook Open event module), and then open Book2 (which
    > > > has
    > > > Application.EnableEvents = False in its ThisWorkbook Open event), ALL
    > > > events
    > > > in both Book1 and Book2 become disabled !!!
    > > >
    > > > Is this how it supposed to work ???
    > > >
    > > > Thank you.

    > >
    > >
    > >


  6. #6
    Chip Pearson
    Guest

    Re: Application.EnableEvents ... Is Local or Global ?

    If you disable events in Book2, and then open Book1, events won't
    fire in Book1 because Book2 disabled events, so your
    Workbook_Open event procedure won't run.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "monir" <monir@discussions.microsoft.com> wrote in message
    news:50F623E1-390C-438D-9D4B-F70072D5594E@microsoft.com...
    > Now ... If I open Book2 first (which has
    > Application.EnableEvents = False),
    > then open Book1 (which has Application.EnableEvents = True),
    > then why ALL
    > events in both Book1 & Book2 become also disabled ?
    >
    > And, if I move the above Aapplication object from ThisWorkBook
    > open event to
    > a Worksheet event, would this make any differenece on how it's
    > treated?
    >
    > Thanks again.
    >
    >
    > "monir" wrote:
    >
    >> Chip & Doug;
    >> Thank you very much for the clarification.
    >>
    >>
    >> "Doug Glancy" wrote:
    >>
    >> > monir,
    >> >
    >> > Properties of the Application object, such as
    >> > EnableEventsand
    >> > ScreenUpdating, apply to all of Excel, i.e., they are
    >> > global.
    >> >
    >> > hth,
    >> >
    >> > Doug
    >> >
    >> > "monir" <monir@discussions.microsoft.com> wrote in message
    >> > news:403BDB19-2B09-4F8B-89AA-3D4A7FD1C06D@microsoft.com...
    >> > > Hello;
    >> > >
    >> > > Book1.xls and Book2.xls, each has few events.
    >> > > For editing purposes, if I open Book1 (which has
    >> > > Application.EnableEvents
    >> > > =
    >> > > True in its ThisWorkbook Open event module), and then open
    >> > > Book2 (which
    >> > > has
    >> > > Application.EnableEvents = False in its ThisWorkbook Open
    >> > > event), ALL
    >> > > events
    >> > > in both Book1 and Book2 become disabled !!!
    >> > >
    >> > > Is this how it supposed to work ???
    >> > >
    >> > > Thank you.
    >> >
    >> >
    >> >




+ 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