"Kicking Out" Inactive users 2

P

PaulW

In reference to this macro below (which is great by the awy) i can get it to
work, but it closes the spreadsheet regardless of activity after the time
limit. I have the code as it appears below in these threads, any ideas?

------------------------------------
Mike, just tested and it works for me, try taking out the lines

ThisWorkbook.Save
ThisWorkbook.Close

and replacing with this

ThisWorkbook.Close True

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003




Mike The Newb said:
Paul - almost there!

Paul - almost there.

The code works great up until ThisWorkbook.Close and I get a "code
interrupted" pop up; when I choose Debug it highlights the
ThisWorkbook.Close
and if I hit continue it runs its course and closes the file. Oddly, it
does
close itself, without any issues, if I am not in an Excel window watching
it
do its thing.

Dim DownTime As Date
Sub SetTime()
DownTime = Now + TimeValue("00:00:20")
Application.OnTime DownTime, "ShutDown"
End Sub

Sub ShutDown()
ThisWorkbook.Save
ThisWorkbook.Close
End Sub

Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=DownTime, Procedure:="ShutDown",
Schedule:=False
End Sub

Regards,
Mike



Was this post helpful to you?

1 out of 1 people found this post helpful.



Expand AllCollapse All

Manage Your Profile |Contact us
© 2006 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks
|Privacy Statement
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top