i would appreciate if anyone can see any possible cases where this routine could fail or error
or other possible improvements
the idea is to limit the maximum number if iterations (user set maxe) per hour, the test below i have changed to minutes, for testing purposes,
within the application, this is actually in a do loop, e = e +1, with unknown maximum, but i would expect to always be less than 100000vb Code:
Sub test() Dim strtime As Date, e As Long, maxe As Long strtime = Now maxe = 850 For e = 1 To 100000 If e Mod maxe = 1 And Not e = 1 Then ' .Disconnect Do Until DateDiff("s", strtime, Now) > (e \ maxe) * 60 DoEvents Sleep 3000 Loop ' .Connect Debug.Print Now End If Next End Sub
the computer is unlikely to be used for other purposes while this routine is running
