If a script is running flawless in studio but automated it halted: its probable because of resolution difference or scripts that left commandline or browsers open and left. Or Excel blocked a excel sheet you use in your script.
a trick is to adding a cleanup/part before starting you actial script and use QRES.exe (free to download) to match the screen resolution of the bot by default.