Excel automation: Excel file got hanged

datatable
excel

#1

image

I simply add a sequence for excel automation, in which it will read excel file and then display data into message box. After executing the workflow it is successfully displaying the excel data into message box but my excel file get stuck and come up with this error:
check excel footers error object reference not set to an instance of an object

Please tell me how can I solve this problem.


#2

@sandeepbhatt can u share your workflow?


#3

I am not authorized to do it from my office laptop, A screen shot of workflow will be helpful to understand problem?


#4

Hello @sandeepbhatt

Make sure “Add Headers” is checked in properties and you have a DataTable type variable in the output with default value New System.Data.DataTable


#5

Thanks Rishabh,
Problem has solved. I just add “New System.Data.DataTable” as a default.
Can you please elaborate this how this problem has solved just adding this default variable value.


#6

If you don’t initialize a variable it will take its default value, in case of value types like String, Integer it’ll work even if you do not assign in some initial value, but Arrays, DataTables, lists, dictionaries need to be given a initializaton value as default to avoid such error! :slight_smile:

I hope you found this useful.

Cheers


#7

Check the scope of the data table variable and there may be chances of using another data table variable which is not having any values.


#8

Thanks Rishabh :grinning:


#9

Thanks Mahaling