Prev: date handling problem with International issues
Next: Addins attached only to selected workbook(s)??
From: ordnance1 on 29 May 2010 05:00 Solved "ordnance1" <ordnance1(a)comcast.net> wrote in message news:5B877667-2A7B-46D6-801F-F3B57C6E6C92(a)microsoft.com... > An additional question > > In your post you said I should remember to cancel the second OnTime before > I quite Excel. So I added the line below to my BeforeClose routine, but I > get an error Method 'OnTime' of object'_Application failed. > > > Application.OnTime RunWhenSplash, "ShowMySplash", , False > > > "ordnance1" <ordnance1(a)comcast.net> wrote in message > news:#FBk2Wj$KHA.4308(a)TK2MSFTNGP04.phx.gbl... >> I will give that a try tomorrow. Thanks a lot. >> >> >> "EricG" <EricG(a)discussions.microsoft.com> wrote in message >> news:6A62F6C5-3535-457E-8652-A165EC2FCD19(a)microsoft.com... >>> You can simply add a second OnTime function. Define the CONSTANT >>> SPLASH_MINUTES to be 7, and then add this code: >>> >>> RunWhenSplash = Now + TimeSerial(0, SPLASH_MINUTES, 0) >>> Application.OnTime RunWhenSplash, "ShowMySplash", , True >>> >>> Public Sub ShowMySplash >>> ClosingSplashScreen.Show ' Modal or Not? >>> ' Do something based on user response? >>> End Sub >>> >>> Don't forget to cancel the second OnTime before you quit Excel: >>> >>> Application.OnTime RunWhenSplash, "ShowMySplash", , False >>> >>> HTH, >>> >>> Eric >>> >>> "ordnance1" wrote: >>> >>>> I have this timer code I got courtesy of Chip Pearson >>>> (http://www.cpearson.com/excel/TimedClose.htm) and am wondering if it >>>> can be >>>> altered in such a way that when I get down to 3 minutes (NUM_MINUTES is >>>> set >>>> to 10 minutes) ClosingSplashScreen.Show will run? >>>> >>>> Private Sub Workbook_Open() >>>> >>>> On Error Resume Next >>>> Application.OnTime RunWhen, "SaveAndClose", , False >>>> On Error GoTo 0 >>>> RunWhen = Now + TimeSerial(0, NUM_MINUTES, 0) >>>> Application.OnTime RunWhen, "SaveAndClose", , True >>>> >>>> End Sub >>>>
First
|
Prev
|
Pages: 1 2 Prev: date handling problem with International issues Next: Addins attached only to selected workbook(s)?? |