View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
evillen[_5_] evillen[_5_] is offline
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