Check excel file

Hello! How to check excek file: empty or fill?
Also, if fill check on template.
Column and row names as in the template

1 Like


You can check whether a excel file is empty or not by using the following steps.

  1. use a Read range acitivity to read the excel sheet onto a datatable
  2. use the below command to get the row count of the datatable. if the datatable has a row count greater than 0, that means the excel file has data. if not, it is empty

if DT.Rows.Count() > 0
– it is not empty
– It is empty


@Lahiru.Fernando This is a good way to check dataTable.

Also you can check in if condition
dt is nothing if it’s true dataTable is empty else not.

Cheers @RPA3


This link may help you,

1 Like

Thanks! It works! And how to check for a template?

Can you show a screenshot of the excel template so that I can tell you the best approach to check it?

example.xlsx (8.0 KB)

Please go throug with this:

Cheers @RPA3

1 Like

I have done it. And how to check what exactly these rows and columns are in the file and nothing more?