Why if starting cell value is empty get the error message " Object not set to instance of Object "?

HI guys,

I’m reading some cell values from excel sheet and displaying the results based on some condition in (IF). It will work fine if all cell have values but will throw an error if the first cell is empty. : " Object not set to instance of Object "

I’m reading cell B6 B7 B8: if all have values the result is fine
If B7 or B8 is empty: result is fine.
But if B6 is empty I’m getting this error " Object not set to instance of Object "
If I display value B6 outside the loop I get empty message, but inside the for each loop If condition this error comes.

FYI: reading cell values and column A20 and looping the column value based on IF condition.

Any help!

Thank you!

1 Like

what is the condition you are writing?

Just to check if cell B4 contains a certain string value. Like if B4 contains string “Item”

you can do this row("yourColumnName).ToString.Contains(Item.ToString)
and check if you are using two different for each loops make changes accordingly!
cheers
@batBot

Ok I will check it.

For reference I’m attaching the workflow with excel examples two conditions. It will work for 1st excel file.

test.zip (28.4 KB)

Any help guys

@batBot Change Data type of variable “ty” to String.
I have tested it’s working fine after changing it.

2 Likes

I forgot to change it to string such a simple mistake… :dizzy_face:

1 Like

Human and Bot both make mistake :sweat_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.