How to read excel file if empty

Hiii I have a problem.
How to read the excel file if it is empty?
Any way to handle this?
Error : Object reference not set to an instance of an object.

Why do you want to read an empty file can you please explain your scenario?

Hi Usha!!
I filtered a data from excel 1 and write to excel 2, sometimes, there is no filtered data in excel 2.
then, i read excel 2 to draft for an output, if the excel is empty, no need to send email. if not, send email with the value contains in the excel 2

then write if condition
then if the filter data exist
then use write range in then part

1 Like

@ainaasyhda

use the if condition
if output of excel is null, don’t send a mail
else send a mail