This is my first coding attempt at VBA (6.3) and I'm very ill-rehearsed. I was hoping that someone with more experience would be able to help me out here. This is what I have:
Instead of the horribly inefficient .Wait (.15) I was hoping that someone might be able to describe a better way to ensure that the data has been written. There are occasions that the program itself (on my network of 200+ users) can experiece some latency which will render the (.15) useless. I am unable to find the happy medium because if the (.15) is not long enough even a single time then the macro itself becomes useless. Making it (.1 or .2) would possibly work but in extreme lag spikes.... you get where I'm going.
Thanks!!!!!
Code:
Sub Macro1()
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim x
x=InputBox("How many times should this loop?")
With Session
Do
.TransmitTerminalKey rcAnsiF2Key
.Wait (0.15)
.TransmitTerminalKey rcAnsiF3Key
.Wait (0.15)
x = x-1
Loop while x>0
Exit Sub
ErrorHandler:
.MsgBox Err.Description, vbExclamation + vbOKOnly
End With
End Sub
Thanks!!!!!
Comment