Could not execute code stage because exception thrown by code stage. The handle is invalid

Naresh

New Member
Hi All,

Please some one can help to resolve the below issue I am facing.

Issue: Bot is getting stuck for a long time without termination. And the error mentioned below.

Error: Internal: Could not execute code stage because exception thrown by code stage. The handle is invalid.

Observation done so far :
1) if I restart that resource machine and triggered again it is working fine.
2) Bot is getting stuck for a long time unless we forcely stop that process.

Plz assist here.
 

Pete_L

Active Member
More information is needed in order for us to help you. Please look at the process logs to see which stage is causing the error, and provide details of how that stage is configured.

Generally speaking, a handle is a numeric value that represents an instance of an application, like Excel. In fact, let's use Excel as an example. When you want to open a workbook in Excel, you must first create an instance of Excel before opening the workbook. Creating the instance will output a Handle, which you should store in a number data item. Then, you will refer to that Handle when you want to work with the workbook. Please refer to the Excel VBO documentation for full details.

We will await your post with details about the particular stage you're having a problem with.
 

Naresh

New Member
Hi Pete, Thanks for your advice.

Please observe below points.
1) It is not related to the excel instance for sure.
2) The error is throwing while bot is on stuck like I have witnessed for example: Navigation stage, Read stage, write stage..like many number of different stages. So as per my understanding it is no where related to the specific stage.
3) Bot is getting stuck for a long time as it was throwing internal errors irrespective of stages.
4) Apart from the above internal error I mentioned in the previous comment, I have also witnessed the below error as well.

Internal: Unexpected error. The handle is invalid.

5) Internet Explorer Browser is being used in this process.


Appreciated if you could help.
 

SERBEM

Member
I guess that this exception is comming because the robot is on a wrong page or has focus to a wrong page. I have seen such error a few times. Maybe you could Activate application before you do this action. Or another way arround could be to minimise some windows and than maximize the one the robot should work with before you are doing this action. Its a bit difficult to help you without more informations and screendumps
 

deep.pro09

New Member
Hi Naresh, this error generally comes while taking BP is trying to take screesnshot at exception level. If you could check the screesnhot check box is checked while throwing any exception from object?
 

Naresh

New Member
Yes, it was checked in the exception stage in one of the objects where I had an issue.

But after that I am also trying to take screenshot using one of the action , here also I am getting the same.
 
Last edited:
Top