none
VBA in one workbook stops executing when a different workbook is closed RRS feed

  • Question

  • Has anyone run into this before?  I am using Office 365 and have VB code in one workbook.  It runs and increments a counter every one second - among other things.  Then if I open ANY other Excel file and close it (even if it has no macros or VB code in it), the code stops executing in the first workbook.  If I have the VB window open it shows it is "playing" (running) until I close the second workbook, then it changes to being stopped - just like you hit the Stop button!

    If I close the second workbook by File/Close instead of the "X", the VB code in the first workbook keeps working!

    Mike.

    Friday, December 6, 2019 12:16 AM

All replies

  • Hi,

    How do you open/close the second workbook?  Is the opening/closing operation done in VBA code, or by manual?

    Regards,

    Ashidacchi -- http://hokusosha.com

    Friday, December 6, 2019 2:01 AM