+ Reply to Thread
Results 1 to 5 of 5

Close userform if inactive and the application

  1. #1
    Forum Contributor
    Join Date
    02-12-2013
    Location
    Brussel
    MS-Off Ver
    Excel 2013
    Posts
    134

    Close userform if inactive and the application

    Hi there!

    How can be automatically closed up a userform and the application, if there is no activity on it or on the workbook?

    Many thanks!

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Close userform if inactive and the application

    Good afternoon boboivan

    This has been asked on the forum a couple of times :

    http://www.excelforum.com/excel-programming-vba-macros/600241-excel-vba-close-workbook-after-inactivity.html

    http://www.excelforum.com/excel-prog...-workbook.html

    HTH

    DominicB
    Last edited by dominicb; 02-04-2015 at 11:00 AM.

  3. #3
    Forum Contributor
    Join Date
    02-12-2013
    Location
    Brussel
    MS-Off Ver
    Excel 2013
    Posts
    134

    Re: Close userform if inactive and the application

    Thank you for your quick answer!

    It's my mistake not mentioning that when I open my application, my workbook gets hidden and it's opened only the userform.
    I need a countdown code for the userform if inactive and when the userform gets automatically closed to shut down the application too.
    I've made my research in this matter, but I couldn't find anything suitable.
    I'm not very good with the VBA.

    Thank you again.

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Close userform if inactive and the application

    Hi boboivan

    With a nod to Mr Loz for shamelessly plagarising his code, something like this should work OK :

    In your Userform module :
    Please Login or Register  to view this content.
    In a regular module :
    Please Login or Register  to view this content.
    HTH

    DominicB

  5. #5
    Forum Contributor
    Join Date
    02-12-2013
    Location
    Brussel
    MS-Off Ver
    Excel 2013
    Posts
    134

    Re: Close userform if inactive and the application

    Works great!

    Thank you sir!

+ 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. Can't close an inactive Workbook - result in error 9
    By gototcm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2014, 10:59 PM
  2. Inactive Application Add-In's
    By ChemistB in forum Excel General
    Replies: 2
    Last Post: 01-21-2011, 04:44 PM
  3. close inactive file
    By jseufert in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2009, 03:03 PM
  4. Close excel if inactive
    By LAWDAWG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2008, 06:44 PM
  5. Close excel when inactive
    By jennie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2006, 04:45 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