+ Reply to Thread
Results 1 to 2 of 2

disable and enable macro execution using VBA in another workbook?

  1. #1
    keithb
    Guest

    disable and enable macro execution using VBA in another workbook?

    Workbook A.xls has a Worksheet_Change() subroutine that is unintentionally
    executed when cell content is modified by VBA code in Workbook B.xls.

    Using VBA code executing in Workbook B.xls, I would like to:
    1) disable macro exection for workbook A.xls while its content is being
    manipulated by VBA code in Workbook B.xls;
    2) re-enable macro exection for workbook A.xls prior to saving it.

    Any suggestions?

    Thanks,

    Keith



  2. #2
    Norman Jones
    Guest

    Re: disable and enable macro execution using VBA in another workbook?

    Hi Keith,

    Try wrapping the problematic instruction with EnableEvents statements,
    e'g.:

    Application.enableEvents = False 'Disable events

    'code line(s)


    Application.EnableEvents = True 're-enable events


    ---
    Regards,
    Norman



    "keithb" <[email protected]> wrote in message
    news:[email protected]...
    > Workbook A.xls has a Worksheet_Change() subroutine that is unintentionally
    > executed when cell content is modified by VBA code in Workbook B.xls.
    >
    > Using VBA code executing in Workbook B.xls, I would like to:
    > 1) disable macro exection for workbook A.xls while its content is being
    > manipulated by VBA code in Workbook B.xls;
    > 2) re-enable macro exection for workbook A.xls prior to saving it.
    >
    > Any suggestions?
    >
    > Thanks,
    >
    > Keith
    >




+ 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