Uncertainty with Add Data Row activity

Hi all,

I am trying to store my data in a new DataTable variable. Here is how the logic goes:

If there is an error in the excel sheet, it will add CurrentRow into a new DataTable called dtErrList.

However, every time I run it, it will show object reference not set to an instance of an object.



You need to initialize your DataTable Variable with a Build Data Table activity before adding Rows.

Hope this helps



Please first give a strucutre to the dterrlist table…

You need initialize

Dterrlist = Nee DataTable

and for providing structure you can use below

Dterrlist = dtExtractdata.Clone()

You can use both in assign activities


Hi there,

What I am trying to achieve is that should there be errors in my excel file, the process will first store my data from said excel file in the variable dtErrList. Afterwards I will delete all data on that excel file, and re-write it into the same excel by using Add Most Recent Data into excel. Hope this helps with understanding my situation


Hi there,

Thanks for your solution! It worked for me.


1 Like

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