Write Range: Object reference not set to an instance of an object

hello @Gaurav07

check datatable contains data or not.

regards
Ajay

1 Like

This is basically Null Pointer Exception, you are trying to work with something that is Null

2 Likes

Hi,

I got the same issue.
Datatable IS initialized but NULL. I would expect that the write range activity would write nothing to the workbook and all good.
How do we tackle this?

P.S.:The datatable I have to write sometimes contains data and sometimes not, this is when it is null.

Br,
Dimitrios

I faced the same issue. Do we have a solution ?

1 Like

It was pointing to null reference.
Thanks a lot for your help.

1 Like

Hi Dimitrios,

I think using a try catch activity in this case should solve the problem

Br.

Option 1: Check your input dt contains any values before writing , write only if it contains data in data table
Option 2: Do a validation for inputs and then write with in try catch , both will have same results

I wrote a solution to a newer thread with the same issue (here), but writing here too because this appears to be the topmost Google result.

1 Like