I have a spreadsheet with 100 account#s. The vba code goes thru each record and puts the account# on the attachmate screen. Then press enter. If account# exists, it goes to next screen. If account# doesn't exist, it stays on the current screen and displays error message. It then captures the error message and puts into Excel and goes to the next record.
This works. But is this the best way to do this?
Sess0.screen.PutString strAcct, 7, 22
Sess0.screen.MoveTo 12, 26
Sess0.screen.SendKeys ("<Enter>")
blnFound = Sess0.screen.waitforstring("_ MAIN MENU")
If blnFound = False Then
'capture error
ActiveCell.Offset(0, 12) = Trim(Sess0.screen.getstring(43, 2, 40))
GoTo MoveToNextRecord
End If
This works. But is this the best way to do this?
Sess0.screen.PutString strAcct, 7, 22
Sess0.screen.MoveTo 12, 26
Sess0.screen.SendKeys ("<Enter>")
blnFound = Sess0.screen.waitforstring("_ MAIN MENU")
If blnFound = False Then
'capture error
ActiveCell.Offset(0, 12) = Trim(Sess0.screen.getstring(43, 2, 40))
GoTo MoveToNextRecord
End If