I’ve been getting this error since I installed the updated version of Studio Pro (9.0.4).
I have a main.neek file with loops that call various subprograms. These subprograms also have loops inside of them, more specifically For Each Row activities that loop through an Excel file with a few sheets. This is an example of the situation that generates the error:
The main program
The subprogram
Global variables exported from the main program to the subprogram:
- excelContent
- listOfSheets
- sheetIndex
- loop
Variables imported from the subprogram to the main program:
- verifierSub (subprogram) → verifier (main program)
Basically, the main program calls the subprogram inside a loop. The subprogram then executes actions inside a For Each Row
loop of its own. The verifier
variable determines what message is shown in the Console Log
activities.
When the data in line 2 from the Excel sheet is “—” that means the robot should go to the next sheet. That is signaled byverifier=2
. So the robot exits the subprogram, goes back to the main program, increments some variables to access the next sheet in the Excel file, and enters the subprogram again. When the data in line 2 of the Excel sheet is different from “—”, that signals the robot that it must remain in the For Each Row
loop until it runs through every line in the sheet that contains data. In this caso verifier = 0
, so the robot keeps running For Each Row
loop in the subprogram withut interruption. After it finishes, it eits the subprogram, incrments the varibles in the main program to access the next sheet, and so on and so forth.
Well, that being said, the problem is that the robot executes normally the first time it goes through the For Each Row
activity, but it stops the second time and the console shows the error.
If I put everything in the same program (just one file, no subprogram), it works. But if I try to divide into subprograms, the For Each Row
activity always stops the second time through and the console throws the aforementioned error.
I don’t want to put everything in the same file, it’s too messy. Dividig everything into subprograms makes things easier to organize. Has anybody else experienced a similar problem? Is there a solution to this?