Excel automation: Excel file got hanged

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.

@sandeepbhatt can u share your workflow?

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

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

1 Like

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.

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

1 Like

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.

Thanks Rishabh :grinning:

Thanks Mahaling

Latest video to fetch record from excel its latest technic you must watch if you are working in excel automation