LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Kicking Out Selective (Not all) Inactive Users


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Kicking Out" Inactive Users Mike The Newb Excel Discussion (Misc queries) 11 August 9th 07 05:16 PM
Prevent users from changing the password roel1973 Excel Discussion (Misc queries) 1 April 5th 06 01:21 PM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
How many users can sucessfully use a shared excel workbook? Andrew of EIT Excel Worksheet Functions 1 September 5th 05 02:45 PM
Protecting Workbook Paul Cooling Excel Discussion (Misc queries) 2 March 7th 05 11:55 AM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"