Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Thanks to Paul B I obtained a Standard Module and Workbook code to save and close a file when there's no user interface for a given period of time (active involvement - keystrokes, mouse clicks, etc). The original code was set for 20 seconds, I changed it to five minutes. My company "tags" users by a specific user name (abc1234 - initials and employee number - always seven digits - three alpha and four numeric). When someone is already in a file, the notify/read only pop up shows their username. Somehow, Excel knows whos in it, so it knows whos opening it as well. I would like to modify Paul B's code to exclude certain users from being kicked out for inactivity. Is that possible? The original code from Paul B was as follows: 'put this in a standard module 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, Procedu="ShutDown", Schedule:=False End Sub 'put this in thisworkbook Private Sub Workbook_Open() MsgBox "This workbook will auto-close after 20 seconds of inactivity" Call SetTime End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Call Disable End Sub Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Call Disable Call SetTime End Sub Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range) Call Disable Call SetTime End Sub Thanks in advance for your time and consideration. Regards, Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Kicking Out" Inactive Users | Excel Discussion (Misc queries) | |||
Prevent users from changing the password | Excel Discussion (Misc queries) | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
How many users can sucessfully use a shared excel workbook? | Excel Worksheet Functions | |||
Protecting Workbook | Excel Discussion (Misc queries) |