+ Reply to Thread
Results 1 to 7 of 7

Excel automatic save&close if inactive for 2 hours.

  1. #1
    Registered User
    Join Date
    09-01-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    3

    Question Excel automatic save&close if inactive for 2 hours.

    Hello.
    I would like to know if this macros is possible? If it is, would you mind explaining what exactly I should be doing, because I'm a total newcomer when it comes to Excel's macros.
    Thank you very much guys&gals.


    Best regards,
    Aleksey.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Excel automatic save&close if inactive for 2 hours.

    Hi

    It is possible, and you'll need to so some research on Application.OnTime. Basically, you'll set this to be 2hrs on opening, then cancel and reset on things like Sheet Selection Change or Sheet Change.

    Cheers
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    09-01-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Excel automatic save&close if inactive for 2 hours.

    Quote Originally Posted by nathansav View Post
    Hi

    It is possible, and you'll need to so some research on Application.OnTime. Basically, you'll set this to be 2hrs on opening, then cancel and reset on things like Sheet Selection Change or Sheet Change.

    Cheers
    Like I said, I'm really bad @ Excel marcoing, and when I try to do smth like this: http://www.biz-development.com/Softw...-Idle-Time.htm
    It just does not work! I open the spreadsheet, go idle for a huge amount of time and nothing happens even tho the timer is set for 20 seconds, it kinda works if I hit Macros -> Reset (macro) and run it, but it just closes the spreadsheet in 20 seconds even tho I'm not idle.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Excel automatic save&close if inactive for 2 hours.

    Do some research on the way i suggested then, Application On Time and the Worksheet Change events.

  5. #5
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Lightbulb Re: Excel automatic save&close if inactive for 2 hours.

    Hi Aleksey,

    Try below code in normal module.

    Please Login or Register  to view this content.
    In Thisworkbook module

    Please Login or Register  to view this content.
    Regards,
    Nandkumar S.
    ---------------------------------------------------------------
    Don't forget to Click on * if you like my solution.

  6. #6
    Registered User
    Join Date
    09-01-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Excel automatic save&close if inactive for 2 hours.

    Quote Originally Posted by satputenandkumar0 View Post
    Hi Aleksey,

    Try below code in normal module.

    Please Login or Register  to view this content.
    In Thisworkbook module

    Please Login or Register  to view this content.
    Unfortunately your code does not work for me, I even changed the 02:00:00 timer to 00:00:20 (for testing purposes) yet absolutely nothing happens. Any idea what I did wrong? Here's a picture of what I've done:
    oi58.tinypic.com/178i6b.jpg

  7. #7
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Thumbs up Re: Excel automatic save&close if inactive for 2 hours.

    Dear Aleksey,

    This is working. Try attached file I have change 25 seconds in it.
    Attached Files Attached Files

+ 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] Automatic save on close but no pop up
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-21-2012, 12:34 AM
  2. Close excel if inactive
    By LAWDAWG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2008, 06:44 PM
  3. Help with automatic save and close after set time
    By redstang423 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-03-2006, 02:25 AM
  4. Close excel when inactive
    By jennie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2006, 04:45 PM
  5. [SOLVED] Option in Excel to save a close a workbook inactive for 5 minutes
    By Patricia Peterson in forum Excel General
    Replies: 4
    Last Post: 01-05-2006, 01:00 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