This just happened to me yesterday. I was also not able to use the link in VJ's post. However, I found the cause. The automation was logging in successfully to the mainframe via Attachmate Extra! Xtreme, and was then trying to enter a 4-character screen name to go to in row 1, column 2 of the screen. (This is the normal place on every screen were a screen name can be entered.) The problem was, on the login success screen where this internal error occurred, row 1 col 2 is not an editable area and will not accept data entry. The internal error: "Failed to set text in Attachmate host due to the session being locked" is a bit misleading. It is not the session that is locked, it is really the area on the screen that is "locked" from data entry. I was able to clear the screen before entering the screen name, and it resolve the issue.