At times, it makes sense to simulate a "program is working" state just for some milliseconds, when interacting with the user.
In these cases i use the following function, which seems to work fine:
Sub Sleep(ms As Long)
Dim now As Long
If ms > 1000 Then ms =1000 'avoid application not responding error
now=DateTime.Now
Do Until (DateTime.Now>now+ms)
DoEvents
Loop
End Sub
Is this bad programming style?