AlbertShenko
Programmer
Using Excel VBA and Attachmate EXTRA! X-treme I am running into issues sending function keys ( <F9> and <F10>)
Here is the code snippet. It is copying data from a csv file and pasting it into Attachmate. To move to the next screen, the F10 key must be pressed. This is not passing through.
I have also tried going the route of trying to access the window manually using AppActivate and to send keys as {f9} and {f10}; but this also does not work.
The tab, down, enter SendKeys all work, including the oSess.Screen.Paste.
Is anyone able to help me figure this out?
Here is the code snippet. It is copying data from a csv file and pasting it into Attachmate. To move to the next screen, the F10 key must be pressed. This is not passing through.
I have also tried going the route of trying to access the window manually using AppActivate and to send keys as {f9} and {f10}; but this also does not work.
The tab, down, enter SendKeys all work, including the oSess.Screen.Paste.
Is anyone able to help me figure this out?
Excel VBA said:[pre] Case "WHATIF"
ReDim wbs(1)
wbs(0) = "C:\TEST1.CSV"
wbs(1) = "C:\TEST2.CSV"
For j = 0 To 1
Workbooks.Open (wbs(j))
Set ws = ActiveWorkbook.ActiveSheet
Application.Wait (Now + TimeValue("0:00:03"))
ws.Range("A1:H1").Copy
oSess.Screen.Paste
oSess.Screen.SendKeys "<F10>"
ws.Range("A2").Copy
oSess.Screen.Paste
oSess.Screen.SendKeys "<F10>"
tickerCount = ws.Range("A" & Rows.Count).End(xlUp).Row
ws.Range("A3:H" & tickerCount).Copy
oSess.Screen.Paste
For k = 3 To tickerCount
oSess.Screen.SendKeys "<UP>"
Next k
For k = 3 To tickerCount
oSess.Screen.SendKeys "<F9>"
oSess.Screen.SendKeys "<TAB>"
ws.Range("I" & k).Copy
oSess.Screen.Paste
Next k
oSess.Screen.SendKeys "<F10>"
oSess.Screen.SendKeys "<DOWN>"
oSess.Screen.SendKeys "<ENTER>"
Call oSess.Screen.WaitForString("RETURN TO BLOCK ORDER STATUS", , , , , 10000)
oSess.Screen.SendKeys "<DOWN>"
oSess.Screen.SendKeys "<DOWN>"
oSess.Screen.SendKeys "<ENTER>"
Next j[/pre]