I'm trying to pause my excel macro in attachmate.
Excel has no pause feature like attachmate. I've
tried to use Sessions settletime but excel just slows
down. I've tried to pause in attachmate sendkeys but
Excel doesn't compile it. I need to pause at a screen
for 3 seconds.
I'm using sendkeys that don't funcion in each particular
screen I need to view for 3 seconds before the macro moves
on. This works, just looking for a better way.
Excel has no pause feature like attachmate. I've
tried to use Sessions settletime but excel just slows
down. I've tried to pause in attachmate sendkeys but
Excel doesn't compile it. I need to pause at a screen
for 3 seconds.
I'm using sendkeys that don't funcion in each particular
screen I need to view for 3 seconds before the macro moves
on. This works, just looking for a better way.
Code:
Sub clear()
ActiveCell.Offset(0, -2) = 1
ActiveCell.Offset(1, 0).Activate
Selection.Copy
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
Set Field = System.ActiveSession.Screen.Area(4, 18, 4, 26)
Field.Select
Field.Delete
Field.Value = ActiveCell
SendKeys "%{TAB}"
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
SendKeys "{ENTER}"
Sess0.Screen.SendKeys ("<Enter>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Call Check
End Sub
Sub bill()
ActiveCell.Offset(0, -1) = 1
ActiveCell.Offset(1, 0).Activate
Selection.Copy
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
Set Field = System.ActiveSession.Screen.Area(4, 18, 4, 26)
Field.Select
Field.Delete
Field.Value = ActiveCell
SendKeys "%{TAB}"
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
SendKeys "+{ENTER}"
Sess0.Screen.SendKeys ("<Enter>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Call Check
End Sub
Sub Check()
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
SendKeys "{F11}" 'opens the screen I need to view
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
SendKeys "{F11}" 'F11 doesn't work in this screen
SendKeys "{F11}" 'therefore giving me about 2 to
SendKeys "{F11}" '3 seconds to view. I need to pause 3
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F11}"
SendKeys "{F3}"
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Call Check2
End Sub
Sub Check2()
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
Sess0.Screen.Moveto 8, 4
Sess0.Screen.SendKeys ("1207")
Sess0.Screen.Moveto 8, 53
Sess0.Screen.SendKeys ("rev<ENTER>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.Moveto 10, 2
Sess0.Screen.SendKeys ("r<ENTER>") 'Opens the screen I need to view.
SendKeys "{F9}" 'F9 doesn't work in this screen
SendKeys "{F9}" 'therefore giving me about 2 to
SendKeys "{F9}" '3 seconds to view. I need to pause 3
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F9}"
SendKeys "{F3}"
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Call Reset
End Sub
Sub Reset()
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System")
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
Sess0.Screen.Moveto 8, 4
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.SendKeys ("<EraseEOF>")
Sess0.Screen.Moveto 8, 53
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.SendKeys ("<EraseEOF>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.SendKeys ("<Enter>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
Sess0.Screen.Moveto 4, 22
End Sub