T
Terry Olsen
I wanted to do this "inline" and not use a timer. Is there a better way?
Do
zipError = UnzipFile(datPath & zipFileName, datPath, False)
If zipError = "Success" Then Exit Do
UpdateStatus("File in use, waiting 5 minutes")
Wait(5)
Loop
Public Sub Wait(ByVal minutes As Integer)
Dim startTime As Integer = Minute(Now)
Dim curTime As Integer
Do
curTime = Minute(Now)
If curTime < startTime Then curTime += 60
If curTime = startTime + minutes Then Exit Sub
Application.DoEvents()
Loop
End Sub
Do
zipError = UnzipFile(datPath & zipFileName, datPath, False)
If zipError = "Success" Then Exit Do
UpdateStatus("File in use, waiting 5 minutes")
Wait(5)
Loop
Public Sub Wait(ByVal minutes As Integer)
Dim startTime As Integer = Minute(Now)
Dim curTime As Integer
Do
curTime = Minute(Now)
If curTime < startTime Then curTime += 60
If curTime = startTime + minutes Then Exit Sub
Application.DoEvents()
Loop
End Sub