Error: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized) in ADD DATA ROW


#1

Hi,

I am getting this error while adding data to dataTable using add data row.
I have initialized all variable with “” except array variables. Please suggest.

Thanks


#2

Hi @rk.sati,

Could you post the screenshot of error message in detail.

Regards,
Hoang Anh.


#3

This error always happens when you have an array or table variable with no data. In this case, it’s most likely the datatable variable has no initial data. I would suggest using Read Range and verifying that part works, or using Build Data Table activity; that way, your datatable has columns and data which you can then add to.


#4

Thanks, I have now initialize my variable and array with blank. Its working fine now