+ Reply to Thread
Results 1 to 5 of 5

Display inactivity timer in text box on userform

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Display inactivity timer in text box on userform

    Hello,

    This is my first post, I do not have alot of programming experience but I have been able to learn a lot thanks to great forums like ExelForum

    I have an inactivity timer which saves and closes the workbook after 25 minutes of inactivity. While they are working in the workbook, there is a userform always on. I would like to have the time remaining until the workbook closes show up in a text box. I am thinking there are a couple ways of doing this but i don't know where to start. Any help would be greatly appreciated!

    Here is the code stored in "ThisWorkbook" and "Module1" which has the timer and a couple other things.

    ThisWorkbook
    Please Login or Register  to view this content.
    Module1
    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: Display inactivity timer in text box on userform

    Welcome Klemmdog,

    I added a second timer and used the Excel Status Bar to display time remaining. When testing I did not use a Userform. I also didn't test the Midnight rollover since that time of day is past my bedtime.

    NOTE: There seems to be some kind of race condition when the 25 minute timer expires that causes the program to restart (it exits fine with a breakpoint in the Workbook_BeforeClose() routine).

    Lewis

    ThisWorkbook
    Please Login or Register  to view this content.

    Module 1
    Please Login or Register  to view this content.
    Last edited by LJMetzger; 01-12-2014 at 09:39 PM. Reason: Added race condition note

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

    Re: Display inactivity timer in text box on userform

    No race condition - just a missing flag. All my known errors have been fixed. Adjust the time back to 25 minutes and enable the Userform and you should be all set.

    Please note that the following syntax is from the 1960s and should be replaced:
    Please Login or Register  to view this content.
    Lewis

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

  4. #4
    Registered User
    Join Date
    01-12-2014
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Display inactivity timer in text box on userform

    Thank you so much for all your help, obviously programming is not my background as you can tell by the ancient syntax.

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

    Re: Display inactivity timer in text box on userform

    My pleasure and thanks for the Rep points. Your syntax gave me flashbacks to 'rock and roll'. I never had a chance for the other two.

    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. [SOLVED] Userform text box to display and edit a single cell only
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 5
    Last Post: 11-25-2013, 08:50 AM
  2. Userform Timer
    By BPB in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2012, 11:02 AM
  3. userform, label text display value depends on user input
    By kp7qc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2011, 05:09 PM
  4. Inactivity Timer
    By RedWing in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2011, 10:31 AM
  5. Display hyperlink text in userform textbox
    By tapapad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2008, 06:37 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