Write DataTable to Excel: Object reference not set to an instance of an object

I am unable to merge a data table; I also tried to write that data table to a sheet. But Continuously i am facing the error as

“Write DataTable to Excel: Object reference not set to an instance of an object.”

All the data tables have at least one line item. However, the system generates an error that I am unable to resolve. Please help me out.

@Muthu_Selva_Karthikeyan

As per error one of the variables that you are using is not having data and is not intialized as well …please check if there are any multiple variables created in different scopes

Cheers

Hey

Looks like you trying to write an empty datatable, please debug your process and check if it getting the right data

Regards