+ Reply to Thread
Results 1 to 2 of 2

Stop all macros when closing a workbook?

  1. #1
    Registered User
    Join Date
    05-08-2005
    Posts
    12

    Stop all macros when closing a workbook?

    Hi,
    I want to stop all macros working when I close a workbook. I have a loop that works every 5 minutes and if you close the work book with out interupting the code it re-opens. Also is the there a simple way to stop code when it is running or is there a status bar saying which macros are running in the background?

    So many thanks for your help?

    Liz

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829
    I believe what you want is a Workbook_close procedure that will terminate the subroutine. I don't know that much about them, the only time I used them was once back when I had 5.0 and they called them Auto_Open and Auto_Close procedures (which I believe still work). VBA Help doesn't seem to have much info on them, but I think it's as simple as defiining a procedure in a Module in that workbook that's called Workbook_Close(). Hopefully someone more familiar with these auto procedures will chime in.

+ 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