Hi guys,
I'm looking for some help with my code below, basically I'm extracting data from specific columns in Extra and pasting back into Excel.
I'm running the code from Excel, I have gotten as far as "getstring" but it doesn't seem to want to copy the data. I've looked around and tried to put together some code, but not at work today so I can't test it.
Any input would be greatly appreciated.
After the system has copied data, I need it pasted back into the active workbook where the macro is running, but I haven't got as far as working the code out for that yet.
Thanks guys.
'--------------------------------------------------------------------------------
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
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 = 30 ' 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)
' This section of code contains the recorded events
ORDERNUMBER = Application.InputBox("PO Number")
Sess0.screen.SendKeys ("6<Enter>")
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
Sess0.screen.SendKeys (ORDERNUMBER)
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
Sess0.screen.SendKeys ("<enter>")
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
aa18 = Sess0.screen.MoveTo(11, 10)
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
Dim A1(), B1() As String
Dim count As Integer
'gets your variables and stores in an array
Do
count = count + 1
ReDim Preserve A1(count)
ReDim Preserve B1(count)
A1(count) = Sess2.screen.GETstring(?, ?, ?)
B1(count) = Sess2.screen.GETstring(?, ?, ?)
Sess2.screen.SendKeys ("<F8>")
Sess2.screen.WaitHostQuiet (1000)
Loop While Sess2.screen.GETstring(where?,where?,16)<>"Foward Completed"
'add coords to the above where "where is"
For count = 1 To count
Sess2.screen.putstring A1(count), ?, ?
Sess2.screen.putstring B1(count), ?, ?
Sess2.screen.WaitHostQuiet (1000)
Next
End Sub
I'm looking for some help with my code below, basically I'm extracting data from specific columns in Extra and pasting back into Excel.
I'm running the code from Excel, I have gotten as far as "getstring" but it doesn't seem to want to copy the data. I've looked around and tried to put together some code, but not at work today so I can't test it.
Any input would be greatly appreciated.
After the system has copied data, I need it pasted back into the active workbook where the macro is running, but I haven't got as far as working the code out for that yet.
Thanks guys.
'--------------------------------------------------------------------------------
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
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 = 30 ' 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)
' This section of code contains the recorded events
ORDERNUMBER = Application.InputBox("PO Number")
Sess0.screen.SendKeys ("6<Enter>")
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
Sess0.screen.SendKeys (ORDERNUMBER)
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
Sess0.screen.SendKeys ("<enter>")
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
aa18 = Sess0.screen.MoveTo(11, 10)
Sess0.screen.WaitHostQuiet (g_HostSettleTime)
Dim A1(), B1() As String
Dim count As Integer
'gets your variables and stores in an array
Do
count = count + 1
ReDim Preserve A1(count)
ReDim Preserve B1(count)
A1(count) = Sess2.screen.GETstring(?, ?, ?)
B1(count) = Sess2.screen.GETstring(?, ?, ?)
Sess2.screen.SendKeys ("<F8>")
Sess2.screen.WaitHostQuiet (1000)
Loop While Sess2.screen.GETstring(where?,where?,16)<>"Foward Completed"
'add coords to the above where "where is"
For count = 1 To count
Sess2.screen.putstring A1(count), ?, ?
Sess2.screen.putstring B1(count), ?, ?
Sess2.screen.WaitHostQuiet (1000)
Next
End Sub