+ Reply to Thread
Results 1 to 3 of 3

Is it possible to prevent WB_BeforeClose with VBA?

  1. #1
    JK
    Guest

    Is it possible to prevent WB_BeforeClose with VBA?

    When opening and then closing WB1 from WB2 I don't want the
    Workbook_BeforeClose macros to execute in WB1. Holding down the shift will
    manually do this, but is there a way with VBA? Thank you.

    Jim Kobzeff




  2. #2
    Dave Peterson
    Guest

    Re: Is it possible to prevent WB_BeforeClose with VBA?

    You can tell excel to stop monitoring events.

    application.enableevents = false
    wb1.close savechanges:=true 'false
    application.enableevents = true



    JK wrote:
    >
    > When opening and then closing WB1 from WB2 I don't want the
    > Workbook_BeforeClose macros to execute in WB1. Holding down the shift will
    > manually do this, but is there a way with VBA? Thank you.
    >
    > Jim Kobzeff


    --

    Dave Peterson

  3. #3
    Chip Pearson
    Guest

    Re: Is it possible to prevent WB_BeforeClose with VBA?

    Jim,

    Try something like

    Application.EnableEvents = False
    WB1.Close
    Application.EnableEvents = True


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




    "JK" <[email protected]> wrote in message
    news:[email protected]...
    > When opening and then closing WB1 from WB2 I don't want the
    > Workbook_BeforeClose macros to execute in WB1. Holding down the
    > shift will manually do this, but is there a way with VBA? Thank
    > you.
    >
    > Jim Kobzeff
    >
    >
    >




+ 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