Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() it seems that you have the application waiting for a time that occurred prior to executing Application.Wait so (it seems to me) that it would have to wait 24hrs before releasing, normally you execute the Wait command like this: Application.Wait (Now() + TimeValue("00:00:30")) Alan;263037 Wrote: I have the following code for pausing before trying an Internet connection (one of a number of them). However, it just hangs there. I am using Windows XP and Excel 2003. Sub WaitSeconds(seconds As Integer) ' ' This subroutine waits for a specified number of seconds. ' Dim CurrentHour As Integer, CurrentMinute As Integer, CurrentSecond As Integer Dim newHour As Integer, newMinute As Integer, newSecond As Integer Dim waitTime As Integer, CurrentTime As Integer CurrentHour = Hour(Now()) CurrentMinute = Minute(Now()) CurrentSecond = Second(Now()) newHour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) + seconds waitTime = TimeSerial(newHour, newMinute, newSecond) Debug.Print "Current time = " & CurrentHour & ":" & CurrentMinute & _ ":" & CurrentSecond Debug.Print "Waiting until " & newHour & ":" & newMinute & _ ":" & newSecond Application.Wait waitTime End Sub Any ideas why it would do this?? I call the subroutine above like this when it hangs: WaitSeconds (2) Thanks, Alan -- Simon Lloyd Regards, Simon Lloyd 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=73434 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application wait question | Excel Programming | |||
Application.wait... won't! | Excel Programming | |||
Please help with Application.Wait ( ) | Excel Programming | |||
Different syntax for Application.Wait | Excel Programming | |||
application.wait help | Excel Programming |