Excel Write Range exception

hello everyone.
I got a problem while i was working in the uipath.
Source:Write range
Writing in a excel sheet displays an error message " Object reference not set to an instance of an object "
Exception Type:System.NullReferenceException
what is the solution for this error?

1 Like

The item which you are writing is Null or empty, please check the values before you are writing.

1 Like

This means that there is no data in the table or it has not been initialized before writing into the excel. Do make sure that you have data in datatable.

Write a check if DataTable.Rows.Count>0 then only it should proceed

1 Like

no sir…
i have already some datas in the sheet

1 Like

attach your workflow, lets see!

1 Like

You have some data in the sheet , but you should check that you are having any data in data table .
Before write range put log message and write datatable.rows.count.tostring

And initialise the datatable means take one assign activity in the beginning of your flow .
Assign yourdatatable = new data table

Implement this , if still not working , upload your workflow.

1 Like