I’m doing the vlookup of excel and use the foreach and always show a error “Objective reference not set to an instance of an object.” I check my codding and find there is a empty row in my datatable used to do the foreach after removing duplicates. Because of the empty row, when the loop goes to this row, it will show error. To solve this problem. I think there are several ways. (may not be correct)
Remove the empty row in datatable
Choose the exact cells instead of choosing the collomn when remove duplicates which cause the empty row in my datatable
During the Foreach, when no value send to the variable. Go for the next row and continue the loop.
Can anybody help me to check my judgment to this error and explain any of the solutions in detail? Thank you very much!
Not more difficult , simplest way may be to use "Get row item " in datatable for-each with a property of ‘ColumnName’ and by using that return value and if condition on true use Remove Data Row activity.
Hello, I would be very interested to know how to solve “3. During the Foreach, when no value send to the variable. Go for the next row and continue the loop.”
Does anyone have the solution ?
Would you be able to go into further detail on how to accomplish this? Specifically, how to use a return value in a “get row item” as well as what expressions to use in the if conditions. Also, how would I use the “remove data row” to remove the duplicate value for the cell?
Hi Akshay, when I am using for each row in a data table, if row contains nothing or “” it is throwing error as null reference error, how to avoid this .