+ Reply to Thread
Results 1 to 12 of 12

2nd Close Workbook after inactivity

  1. #1
    Registered User
    Join Date
    02-18-2005
    Posts
    93

    2nd Close Workbook after inactivity

    I read this post "VBA Close Workbook after Inactivity"and got very excited. It is something I can really use.
    So I pasted all the code from RoyUK in my spreadsheet and set the time parameters to 1 minute to test it. My spreadsheet is still open, so I am wondering what I did wrong. Were some of the procedures supposed to be combined into one? I put them in a module, and listed each one of them seperately as in the example.

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Deb, Roy(uk) is from a different forum, i have supplied a link to this post to him as we havent seen the code and cannot comment especially seeing that you didn't provide any code for us to work with
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    here's a link to the earlier answer.

    I think you have the code in the wrong places.

    This should be in a standard module

    Please Login or Register  to view this content.
    Place this in the Workbook_Open event

    Please Login or Register  to view this content.
    Place this in each worksheet to detect any changes

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    02-18-2005
    Posts
    93

    thanks

    thanks to Simon and RoyU. I will work with it from here. The Clarification helps since I am new to VBA

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Here's an example workbook that might help
    Last edited by royUK; 11-03-2008 at 12:09 PM.

  6. #6
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    RoyUK,

    Thanks you RoyUK. I have been watching this post and the piece of code you put out there is wonderful. Neatest thing I have seen in a while. I put it in a workbook of mine and it works great. I appreciate you sharing with us.

    Deb,

    Thanks for putting that question out there. I am not sure exactly where I will use this application, but it is certainly nice to have. Hope you got the code to work on your end.
    Sincerely,
    Jeff

  7. #7
    Registered User
    Join Date
    01-28-2013
    Location
    Franklin, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: 2nd Close Workbook after inactivity

    Hi, I have copied this code as instructed above, but I am getting errors? What time values to I have to change in the above code?

  8. #8
    Registered User
    Join Date
    01-28-2013
    Location
    Franklin, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: 2nd Close Workbook after inactivity

    Ok, I got it to work, however I want it to save also and I have already coded a autosave in earlier in the code for a reason. However I need another save prior to close? Any help??

  9. #9
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: 2nd Close Workbook after inactivity

    Change this
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor Pierce Quality's Avatar
    Join Date
    07-29-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    221

    Re: 2nd Close Workbook after inactivity

    I was searching for for some code for closing the workbook after inactivity and came across this thread, it was very helpful and the code worked great, thank you.

  11. #11
    Registered User
    Join Date
    09-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: 2nd Close Workbook after inactivity

    hey guys thanks for this. Quick question though, where do I find the "Workbook_Open" event?

  12. #12
    Registered User
    Join Date
    07-16-2017
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    1

    Re: 2nd Close Workbook after inactivity

    Hi Guys

    This is really a great piece of Code.
    I would like to use it on multiple sheets.
    I am getting errors if i paste this code in the sheets i want to use.

    One particular sheet, i don't want to close but I want to call another macro.
    Can it be done?

    I am a self taught and fairly new in VBA.

    Your help is much appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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