Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Shared workbook inactivity warning


I will be very grateful if someone can suggest to me the neatest way t
achieve the following:

I want a visible warning and/or audible alarm to popup after fiv
minutes of inactivity within a workbook session.

The reason for this is that a number of users need to enter data into
'common' index folder, often users will have finished entering thei
data but have left the workbook open, consequently forbidding writ
access to anyone else.

Many thanks
Le

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Shared workbook inactivity warning

The basic code would be found at Chip Pearson's site
http://www.cpearson.com/excel/ontime.htm

You would cancel the ontime in the workbook level selection change event and
schedule a new one 5 minutes hence.

http://www.cpearson.com/excel/events.htm

if you are not familiar with events.

John Walkenbach has code for playing a sound:
http://j-walk.com/ss/excel/tips/tip59.htm



--
Regards,
Tom Ogilvy

evillen wrote in message
...

I will be very grateful if someone can suggest to me the neatest way to
achieve the following:

I want a visible warning and/or audible alarm to popup after five
minutes of inactivity within a workbook session.

The reason for this is that a number of users need to enter data into a
'common' index folder, often users will have finished entering their
data but have left the workbook open, consequently forbidding write
access to anyone else.

Many thanks
Len


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Shared workbook inactivity warning


I appreciate your advice Tom.

I looked at the sources you suggested and created the code below
Whenever I attempt to get the macros to run, I get a warning telling m
that "...!The_Sub' cannot be found".

I am sorry if this is a silly syntax problem, but I am pulling my hai
out over this!

Thanks
Len


Public RunWhen As Double
'Public Const cRunIntervalSeconds = 120 ' two minutes
'Public Const cRunWhat = "The_Sub"
Const cRunIntervalSeconds = 10
Const cRunWhat = "The_Sub"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
schedule:=True
End Sub

Sub The_Sub()
Msg = "Please close this workbook"
MsgBox (Msg)
StartTimer

End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Su

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Shared workbook inactivity warning


I have been looking at this again, and I believe that the problem ha
something to do with my Public Const declarations - the previous cod
was altered to make the constants local to the StartTimer process.

" get a warning that Constants are not allowed as Public members o
object modules". Please see code example below:
---------------------------------------------------------------------------

Public RunWhen As Double
Public Const cRunIntervalSeconds = 120 ' two minutes
Public Const cRunWhat = "The_Sub"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
schedule:=True
End Sub

Sub The_Sub()
Msg = "Please close this workbook"
MsgBox (Msg)
StartTimer

End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Su

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Shared workbook inactivity warning

Put all your code in a general module. ( in the VBE, insert=Module)

Then call the appropriate code from the workbook level selectionchange event
in the Thisworkbook module.

the public variable will be visible to the thisworkbook module as well. (you
can assign them a value and read them from there if you need to).

--
Regards,
Tom Ogilvy

evillen wrote in message
...

I have been looking at this again, and I believe that the problem has
something to do with my Public Const declarations - the previous code
was altered to make the constants local to the StartTimer process.

" get a warning that Constants are not allowed as Public members of
object modules". Please see code example below:
--------------------------------------------------------------------------

-

Public RunWhen As Double
Public Const cRunIntervalSeconds = 120 ' two minutes
Public Const cRunWhat = "The_Sub"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
schedule:=True
End Sub

Sub The_Sub()
Msg = "Please close this workbook"
MsgBox (Msg)
StartTimer

End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Sub


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



Reply
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
shared workbook is set up is not 'shared' on network moviemaker novice Excel Worksheet Functions 0 April 7th 10 03:31 AM
shared workbook - shared workbook options grayed out Edward Letendre Excel Discussion (Misc queries) 0 March 3rd 10 10:47 PM
why do I get a warning when unprotecting a workbook charob Excel Worksheet Functions 1 December 28th 07 02:55 PM
Printing viewing a shared workbook on a shared drive aloomba Excel Discussion (Misc queries) 0 April 13th 07 02:52 PM
update pivot in shared shared workbook 00George00 Excel Discussion (Misc queries) 1 August 23rd 06 08:16 PM


All times are GMT +1. The time now is 07:40 AM.

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

About Us

"It's about Microsoft Excel"