Hi
Hope someone can help me. I am not a programmer, just trying to write a simple macro by reading your post. My macro is in Excel VBA.I have a list of account numbers in column A. My macro should copy the ac# from Excel to Extra and bring up client info on Extra screen, then copy some info from Extra screen wherever the cursor is on Extra. The issue is the cursor position on Extra is not same always.
here is my code
Sub Main()
Dim Sessions As Object
Dim System As Object
Dim myScreen As Object
Dim myArea As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0= System.ActiveSession
Set myScreen = Sess0.Screen
g_HostSettleTime = 300
currentRow = myScreen.Row
current.Col = myScreen.Col
Set myArea = myScreen.Area(currentRow, currentCol, currentRow, currentCol + 12)
Do
Sess0.Screen.PutString(ActiveCell.Value), 22, 16
Sess0.Screen.SendKeys ("<Enter>") 'the cursor is at 22,07 at this point
sess0>Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("<Pf3>") 'at this point the cursor position is either 10,03 or 14,03 or 18,03 or 22,07
Sess0.Screen.WaitHostQuiet (g_HostSettleTime) 'my codes runs ok upto this point.
ActiveCell.offset(0,1)= myArea 'i am stuck here, no matter where the cursor is in Extra, it copies the area 26,07,26,07+12)
ActiveCell.offset(1,0).Select
Loop Until IsEmpty(ActiveCell)
End Sub
what am I doinh wrong? please help.
Hope someone can help me. I am not a programmer, just trying to write a simple macro by reading your post. My macro is in Excel VBA.I have a list of account numbers in column A. My macro should copy the ac# from Excel to Extra and bring up client info on Extra screen, then copy some info from Extra screen wherever the cursor is on Extra. The issue is the cursor position on Extra is not same always.
here is my code
Sub Main()
Dim Sessions As Object
Dim System As Object
Dim myScreen As Object
Dim myArea As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0= System.ActiveSession
Set myScreen = Sess0.Screen
g_HostSettleTime = 300
currentRow = myScreen.Row
current.Col = myScreen.Col
Set myArea = myScreen.Area(currentRow, currentCol, currentRow, currentCol + 12)
Do
Sess0.Screen.PutString(ActiveCell.Value), 22, 16
Sess0.Screen.SendKeys ("<Enter>") 'the cursor is at 22,07 at this point
sess0>Screen.WaitHostQuiet (g_HostSettleTime)
Sess0.Screen.SendKeys ("<Pf3>") 'at this point the cursor position is either 10,03 or 14,03 or 18,03 or 22,07
Sess0.Screen.WaitHostQuiet (g_HostSettleTime) 'my codes runs ok upto this point.
ActiveCell.offset(0,1)= myArea 'i am stuck here, no matter where the cursor is in Extra, it copies the area 26,07,26,07+12)
ActiveCell.offset(1,0).Select
Loop Until IsEmpty(ActiveCell)
End Sub
what am I doinh wrong? please help.