Reading an empty worksheet

I am trying to read a worksheet, if its empty it should create an exception, if not, the process should continue.
Anyone Plz Help

You might want to put the Read Range activity it in a Try Catch. If error occurs you can log a message stating sheet is blank and move on to the next.

And welcome to the forums @Daniyal_Tahir !

1 Like

Hi @Daniyal_Tahir

Just Read the table and then get the count of rows. If count of rows = 0 Then throw Exception.

To get the count of rows you can watch this video: UiPath | Data Table Rows Count | How to get Rows Count of Data Table/Collection | Excel Rows Count - YouTube

Best regards
Mahmoud

Hi @Daniyal_Tahir ,

You can also read range without headers and then use datatable.rows.count>0 then Use actual read range which have headers selected in property.
Else throw exception.

Thanks.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.