+ Reply to Thread
Results 1 to 7 of 7

How do i stop a timer

  1. #1
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    How do i stop a timer

    Hi

    I have a timer that runs to send a mail based on criteria. Problem is....the timer does not stop.....ever.....mailbox flooded, please help urgently.

    Please Login or Register  to view this content.
    the code above is what I used....I need something in before close to stop the timer 'cause it does not stop when I close the workbook.

  2. #2
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: How do i stop a timer

    the end result I'm looking for is for the timer to run every 2 minutes and check for the criteria as per the below but, I am not 100% sure the below code is right?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: How do i stop a timer

    I don't know what criteria you want but the submited code works like this:
    For each value in range:
    if value = 3 call Mail43 AND then call Timer1
    if value <> 3 call Timer1
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  4. #4
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: How do i stop a timer

    thank you for the reply, but I need the code to stop the timer running.....when I close the workbook......the timer just keeps on running, so I need to put something in the "before workbook close" event to stop the code from running when I close the workbook.

  5. #5
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: How do i stop a timer

    get the Call Timer1 out of the For Nex loop:
    Please Login or Register  to view this content.
    The timer should stop if you close the file. But maybe you should implement a method/condition to stop the timer.

  6. #6
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: How do i stop a timer

    tried another approach much like you are suggesting.

    thank you very much for the assistance bulina2kn

  7. #7
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: How do i stop a timer

    Did you try this?
    PHP Code: 
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
        
    Application.OnTime Now TimeValue("00:02:00"), "Check1", , False
    End Sub 

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Stop timer
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-23-2016, 05:36 PM
  2. Timer Stop when other CommandButton Clicked
    By iqballud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2015, 09:23 AM
  3. Progress Bar or Timer or Stop Watch
    By DD1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2015, 06:01 PM
  4. Start/Stop timer
    By JonathanB2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 07:00 AM
  5. how to stop a macro timer running more then once
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2013, 08:58 PM
  6. [SOLVED] Timer non-stop to run?
    By alee001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2013, 03:46 PM
  7. Replies: 1
    Last Post: 12-12-2012, 08:46 PM

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