Sub Macro11()
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System Is Nothing) Then
MsgBox "Could not create the EXTRA System object. Stopping macro playback."
Stop
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "Could not create the Sessions collection object. Stopping macro playback."
Stop
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 250 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."
Stop
End If
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Range("a2").Select
Do
r = 7
dd = 7
Do
PO = Sess0.Screen.Area(6, 10, 6, 22, Page)
If PO = "*************" Then
r = 23
t = 2
Else
Sess0.Screen.MoveTo 6, 2
Sess0.Screen.SendKeys ("S")
Sess0.Screen.SendKeys ("<Enter>")
keycode = Sess0.Screen.Area(r, dd, r, dd + 7, Page)
Selection = keycode
Sess0.Screen.MoveTo 1, 2
If keycode = "********" Then
Sess0.Screen.MoveTo 1, 2
Sess0.Screen.SendKeys ("C1")
Sess0.Screen.SendKeys ("<Enter>")
Else
ActiveCell.Offset(0, 1).Select
store = Sess0.Screen.Area(r, dd + 9, r, dd + 12, Page)
Selection = store
ActiveCell.Offset(0, 1).Select
qty = Sess0.Screen.Area(r, dd + 46, r, dd + 50, Page)
Selection = qty
ActiveCell.Offset(1, -2).Select
r = r + 1
End If
Loop Until r = 23
Sess0.Screen.SendKeys ("<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
Loop Until t = 2
End Sub