+ Reply to Thread
Results 1 to 7 of 7

Macro to save and close an excel spreadhseet if idle

  1. #1
    Registered User
    Join Date
    05-12-2018
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    19

    Question Macro to save and close an excel spreadhseet if idle

    Dear All,
    I have a shared spreadsheet used by different people and there is a chance that someone leaves the spreadsheet open and no one else can't be accesssed. What I need is a macro that save the workbook and then closes, if left idle for 2 mins. The thing is that I am already using some macros in the spreadsheet and I don't know how to incorporate the same. Attached the file for reference.

    Thanks in Advance.

    Jefy
    Attached Files Attached Files

  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: Macro to save and close an excel spreadhseet if idle

    Good morning jefyninan

    Have a look at Allen Wyatt's code here.

    The only change you'll need to make to fit it in with yours is the Workbook_Open module, which will need to read :
    Please Login or Register  to view this content.
    Everything else can remain unchanged. You won't need to use his Workbook_Open code - the above will handle it.

    HTH

    DominicB

  3. #3
    Registered User
    Join Date
    05-12-2018
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    19

    Re: Macro to save and close an excel spreadhseet if idle

    Sir,

    I have got very little knowledge about the vba coding. Whatever in the attachment is helps received from colleagues and internet. Could you please help me incorporating the same to my sheet...(if possible??)

    Thanks

  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: Macro to save and close an excel spreadhseet if idle

    Hi jefyninan

    Currently set for 1 minute, due to this line :
    Please Login or Register  to view this content.
    in the SetTimer module, in Module2 - this is in hh:mm:ss format. Change to whatever suits your needs.

    I also fixed another error that occurred on opening.

    HTH

    DominicB
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-12-2018
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    19

    Re: Macro to save and close an excel spreadhseet if idle

    Hi Dominic,
    I checked the file and noticed these two issues:
    1. Its not saving the data automatically, after the set time.
    2. The first two columns (:Sl. No" & "Date") were locked and dont want the users to edit the values.
    Hope you can fix this too....Many thanks!!

    jefy

  6. #6
    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: Macro to save and close an excel spreadhseet if idle

    hi jefyninan

    Now fixed.

    HTH

    DominicB
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-12-2018
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    19

    Re: Macro to save and close an excel spreadhseet if idle

    Hi Dominic,
    Thank you so much for your great efforts.
    Its now working as per my needs!!

    Jefy

+ 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. Excel Not Responding after running Save and Close Macro Button
    By mangesh.mehendale in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2016, 08:25 AM
  2. Excel Idle Time Close
    By MarkSSDM in forum Excel General
    Replies: 3
    Last Post: 04-14-2015, 11:23 AM
  3. Auto Close Idle Outlook
    By zplugger in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 02-23-2014, 03:36 PM
  4. Replies: 1
    Last Post: 10-25-2013, 06:10 PM
  5. [SOLVED] Userform idle for 1 minutes , how to close Workbook linked to it ?
    By stevnb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2012, 09:05 AM
  6. Macro to Open, Save and Close Excel Files
    By az! in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2011, 04:19 AM
  7. Auto save and close workbook after user defined length of idle time
    By Nickster64 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2008, 10:30 AM

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