Using the “Read Range Workbook” activity without defining the range. Basically the process reads a spreadsheet for “Open” records and adds them to the orchestrator queue to be processed. This runs fine, the problem is that at the end of the process when it goes back to read the workbook and change the “Open” to “Closed” it causes an error:
“Read Range Workbook: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. (Parameter ‘count’)”
I don’t understand why this issue is happening as there is no range set. It just reads the entire spreadsheet. This only happens if there are “Open” records further up the list. If there is just one “Open” record then it runs fine. I’ve tried a try/catch to use excel activities if the “Read Range Workbook” creates an error, but using the proper excel activities presents an issue as it’s slower, and also requires a specific range which doesn’t work as the excel spreadsheet can become quite long (800+).
Can anyone suggest why this error is happening and how I could get around it? I’ve tried googling online but none of the other topics seem to match my specific issue.
The error happens regardless of whether it’s in the Excel process scope. That was my attempt at a fix. I have another read-range activity elsewhere in the process that has also begun throwing the same error and isn’t inside an Excel scope.
I have “solved” the problem with a try/catch that uses modern activities and a defined range to read, but this could cause problems in the future if the team I am building this for do not regularly cleanse the spreadsheet being targeted.
Had to use a workaround rather than a fix. Essentially a try/catch activity containing the old read-range activity, then the modern excel activities with a defined range.
This isn’t an ideal fix as the team will have to regularly cleanse the spreadsheet that the bot is reading, but it prevents errors in the process at least.