I am new to this forum and posting - but here is my issue. I am trying to grab data that is located on multiple pages in the same location. The Macro goes to a file and gets the part numbers (from input file) and then goes to get the data from Attachmate to put in another (output) file. This works for all data on the first page in Attachmate but when it goes to page 2 for each part number - which I see it go to on my screen - it returns the same data that was on page 1. I do not know how or what to do to fix this. Any help or direction would be great ! Thank you.
'======= Start of program
Open "C:\Users\dzgwtn\Desktop\Macro info\MXAdjustment.csv" for input as #1
Open "C:\Users\dzgwtn\Desktop\Macro info\MXAdjustment Report.csv" for output as #2
ACTION = "C"
INQ1100COMPLETE = "I0001"
UPD1100COMPLETE = "COMPLETE"
Sess0.Screen.WaitHostQuiet(1500)
Input #1, partx$
PartNum = right$("00"+partx,8)
Sess0.Screen.Sendkeys("<Clear>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("ms8p1100 <Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("t <tab><tab><tab><tab>0000 LGE <Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
While not eof(1)
Sess0.Screen.MoveTo 3, 42
Sess0.Screen.Sendkeys(PartNum+"<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.MoveTo 3, 42
Sess0.Screen.Sendkeys("<EraseEOF>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Upd1100 = ""
Upd1100 = Sess0.Screen.GetString(8,25,4)
Upd1200 = Sess0.Screen.GetString(9,25,4)
Upd1300 = Sess0.Screen.GetString(10,25,4)
Upd1400 = Sess0.Screen.GetString(11,25,4)
Upd1500 = Sess0.Screen.GetString(12,25,4)
Upd1600 = Sess0.Screen.GetString(13,25,4)
Upd1700 = Sess0.Screen.GetString(14,25,4)
Upd1800 = Sess0.Screen.GetString(15,25,4)
Upd1900 = Sess0.Screen.GetString(16,25,4)
Upd2000 = Sess0.Screen.GetString(17,25,4)
Upd2100 = Sess0.Screen.GetString(18,25,4)
Upd2200 = Sess0.Screen.GetString(19,25,4)
Upd2300 = Sess0.Screen.GetString(20,25,4)
'==============Got to next page and continue to get data
Sess0.Screen.Sendkeys("<PF8>")
Sess0.Screen.Sendkeys("<tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Upd2400 = ""
Upd2400 = Sess0.Screen.GetString(8,25,4)
Upd2500 = Sess0.Screen.GetString(9,25,4)
Upd2600 = Sess0.Screen.GetString(10,25,4)
Upd2700 = Sess0.Screen.GetString(11,25,4)
Upd2800 = Sess0.Screen.GetString(12,25,4)
Upd2900 = Sess0.Screen.GetString(13,25,4)
Upd3000 = Sess0.Screen.GetString(14,25,4)
Upd3100 = Sess0.Screen.GetString(15,25,4)
Upd3200 = Sess0.Screen.GetString(16,25,4)
Upd3300 = Sess0.Screen.GetString(17,25,4)
Upd3400 = Sess0.Screen.GetString(18,25,4)
Upd3500 = Sess0.Screen.GetString(19,25,4)
Upd3600 = Sess0.Screen.GetString(20,25,4)
'====Put data into excel file
Print #2, PartNum+","+Upd1100+","+Upd1200+","+Upd1300+","+Upd1400+","+Upd1500+","+Upd1600+","+Upd1700+","+Upd1800+","+Upd1900+","+Upd2000+","+Upd2100+","+Upd2200+","+Upd2300+","+Upd2400+","+Upd2500+","+Upd2600+","+Upd2700+","+Upd2800+","+Upd2900+","+Upd3000+","+Upd3100+","+Upd3200+","+Upd33000+","+Upd3400+","+Upd3500+","+Upd3600
Input #1, partx$
PartNum = right$("00"+partx,8)
'======= Start of program
Open "C:\Users\dzgwtn\Desktop\Macro info\MXAdjustment.csv" for input as #1
Open "C:\Users\dzgwtn\Desktop\Macro info\MXAdjustment Report.csv" for output as #2
ACTION = "C"
INQ1100COMPLETE = "I0001"
UPD1100COMPLETE = "COMPLETE"
Sess0.Screen.WaitHostQuiet(1500)
Input #1, partx$
PartNum = right$("00"+partx,8)
Sess0.Screen.Sendkeys("<Clear>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("ms8p1100 <Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("t <tab><tab><tab><tab>0000 LGE <Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
While not eof(1)
Sess0.Screen.MoveTo 3, 42
Sess0.Screen.Sendkeys(PartNum+"<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.MoveTo 3, 42
Sess0.Screen.Sendkeys("<EraseEOF>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Upd1100 = ""
Upd1100 = Sess0.Screen.GetString(8,25,4)
Upd1200 = Sess0.Screen.GetString(9,25,4)
Upd1300 = Sess0.Screen.GetString(10,25,4)
Upd1400 = Sess0.Screen.GetString(11,25,4)
Upd1500 = Sess0.Screen.GetString(12,25,4)
Upd1600 = Sess0.Screen.GetString(13,25,4)
Upd1700 = Sess0.Screen.GetString(14,25,4)
Upd1800 = Sess0.Screen.GetString(15,25,4)
Upd1900 = Sess0.Screen.GetString(16,25,4)
Upd2000 = Sess0.Screen.GetString(17,25,4)
Upd2100 = Sess0.Screen.GetString(18,25,4)
Upd2200 = Sess0.Screen.GetString(19,25,4)
Upd2300 = Sess0.Screen.GetString(20,25,4)
'==============Got to next page and continue to get data
Sess0.Screen.Sendkeys("<PF8>")
Sess0.Screen.Sendkeys("<tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Upd2400 = ""
Upd2400 = Sess0.Screen.GetString(8,25,4)
Upd2500 = Sess0.Screen.GetString(9,25,4)
Upd2600 = Sess0.Screen.GetString(10,25,4)
Upd2700 = Sess0.Screen.GetString(11,25,4)
Upd2800 = Sess0.Screen.GetString(12,25,4)
Upd2900 = Sess0.Screen.GetString(13,25,4)
Upd3000 = Sess0.Screen.GetString(14,25,4)
Upd3100 = Sess0.Screen.GetString(15,25,4)
Upd3200 = Sess0.Screen.GetString(16,25,4)
Upd3300 = Sess0.Screen.GetString(17,25,4)
Upd3400 = Sess0.Screen.GetString(18,25,4)
Upd3500 = Sess0.Screen.GetString(19,25,4)
Upd3600 = Sess0.Screen.GetString(20,25,4)
'====Put data into excel file
Print #2, PartNum+","+Upd1100+","+Upd1200+","+Upd1300+","+Upd1400+","+Upd1500+","+Upd1600+","+Upd1700+","+Upd1800+","+Upd1900+","+Upd2000+","+Upd2100+","+Upd2200+","+Upd2300+","+Upd2400+","+Upd2500+","+Upd2600+","+Upd2700+","+Upd2800+","+Upd2900+","+Upd3000+","+Upd3100+","+Upd3200+","+Upd33000+","+Upd3400+","+Upd3500+","+Upd3600
Input #1, partx$
PartNum = right$("00"+partx,8)