+ Reply to Thread
Results 1 to 2 of 2

Stopping Application OnTIme when closing a workbook

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

    Stopping Application OnTIme when closing a workbook

    Hi,

    I want to stop a loop of

    Application.OnTime Now + TimeValue("00:01:00"), "NextSub"
    when I close a workbook using Sub Auto_Close, it stops when I close excel but reopens and continues to run in the background when I just close the workbook.

    Thanks for you help

    Liz

  2. #2
    Registered User
    Join Date
    08-20-2003
    Location
    Luton, England
    Posts
    63
    Don't understand that because the timer process should be cancelled when the workbook closes. I would double check the Workbook_Open etc. to make sure that nothing starts when the workbook is opened.

    The problem is that to stop the timer we need to know the exact time it was set for and have it stored in a variable. If you close the workbook, how is Excel to know this ? The only way to do this would be to save the value in a cell and save - and, as stated, this should not be necessary.

    Here is some code :-
    Please Login or Register  to view this content.
    Regards
    BrianB
    Most problems are caused by starting from the wrong place.
    Use a cup of coffee to speed up all Windows processes.
    It's easy until you know how.
    -----------------------------------------

+ 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