+ Reply to Thread
Results 1 to 5 of 5

Userform idle for 1 minutes , how to close Workbook linked to it ?

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Zutphen
    MS-Off Ver
    Excel 2003
    Posts
    56

    Question Userform idle for 1 minutes , how to close Workbook linked to it ?

    Hello
    On my search to the perfect monkey proof data entry screen (userform), there is one problem.

    More people use the same file(workbook), entering data on the userform only takes several seconds.
    I have programmed the userform in a way when they press OK the data adds on the workbook. And the workbook closes and saves.

    But , if someone leaves the screen and didn't press the OK button yet, other people might have to wait for him.(read-only )
    To solve this i want a Visible timer on the userform and a VBA code to close the workbook and save 50 seconds after the person started entering data.

    Or something with Mouse idle? that would be even better. Goal: Mouse didn't move for 50 seconds: Close and save workbook , BUT keep userform open.

    Yours , Steven

  2. #2
    Registered User
    Join Date
    11-05-2012
    Location
    Zutphen
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Userform idle for 1 minutes , how to close Workbook linked to it ?

    Anyone?

    I have tried something like this.

    At userform_initialize

    Please Login or Register  to view this content.

    And this is just in a normal module
    Please Login or Register  to view this content.
    But this is not working. I dont know why

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Userform idle for 1 minutes , how to close Workbook linked to it ?

    Try this:
    In the "ThisWorkbook" module:
    Please Login or Register  to view this content.
    And a regular module:

    Please Login or Register  to view this content.
    Good luck! (Not tested)
    Last edited by MBlaster; 12-03-2012 at 06:29 PM. Reason: Added Code tags (oops! :))

  4. #4
    Registered User
    Join Date
    10-11-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Userform idle for 1 minutes , how to close Workbook linked to it ?

    I think this will work, while it focuses on changes made to the workbook, your form does just that with the data entry right? You could probably adapt it to count down specifically the userform if you wanted, I'm not too good with capturing userform events just yet.

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    Zutphen
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Userform idle for 1 minutes , how to close Workbook linked to it ?

    Thanks MBlaster!

    I think that would have worked , but i have already found another way of doing it! ( might be easier)

    For all of you googlers out there here it is:
    Please Login or Register  to view this content.
    Then you put this at every button you have on your userform.
    Please Login or Register  to view this content.
    This resets the timer everytime you press a button on the userform.
    And if you don't it will close after 15 seconds.

    Yours, Steven

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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