+ Reply to Thread
Results 1 to 2 of 2

Stopwatch functionality giving occasional errors, not sure how to fix

  1. #1
    Registered User
    Join Date
    08-24-2017
    Location
    Umeå, Sweden
    MS-Off Ver
    Excel 2017
    Posts
    1

    Exclamation Stopwatch functionality giving occasional errors, not sure how to fix

    Hello

    I'm trying to create a scoreboard-type thing using a stopwatch and some data logging. It all seems to work well enough for my purposes except for one thing: sometimes, the "stop" button doesn't actually stop the timer, but simply records the data and resets the input fields, but the timer keeps ticking.

    The problem can be seen here: most of the time it works, but on occasion, the timer doesn't stop.

    https://www.youtube.com/watch?v=htkB...ature=youtu.be

    The main module can be seen here. The sub called when pressing the stop button is the "stopTimer".

    I've tried using an error handler that would simply loop around and start the "stopTimer" sub again when it fails, but that just crashes excel.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Stopwatch functionality giving occasional errors, not sure how to fix

    Hi MagnusNM and congratulations on your first post. Thank you for using CODE TAGS. It is good that you are using 'Option Explicit', which solves a lot of problems before the problems can be created.

    It is difficult to diagnose your problem without having a sample data file. It seems like you may have a 'race condition' where you stopped the timer, just before the next timer cycle is scheduled to run. The following untested code may solve your problem (changes in red).

    Please Login or Register  to view this content.
    If you are still having problems, please upload a sample file. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Lewis

+ 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. Formulas giving unexpected errors
    By Nifty62 in forum Excel General
    Replies: 6
    Last Post: 08-27-2014, 01:00 PM
  2. [SOLVED] AddItem and Clear Giving Errors when Run
    By scass in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-14-2013, 01:06 AM
  3. VBA keeps giving errors on PasteSpecial
    By Inter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2012, 11:45 PM
  4. Excel giving random #N/A errors
    By Fuzz in forum Excel General
    Replies: 2
    Last Post: 08-22-2009, 09:17 PM
  5. [SOLVED] Re: Range().resize giving errors
    By Harry Tuttle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2005, 02:35 PM
  6. [SOLVED] Range().resize giving errors
    By Harry Tuttle in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-27-2005, 03:45 PM
  7. Range().resize giving errors
    By Harry Tuttle in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-27-2005, 03:25 PM

Tags for this Thread

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