We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Checking for Empty excel file using Aspose.Cells

Hi All,

I am using Aspose api for reading and writing excel files.but while reading the Excel files i want to check condition for whether the Excel file contains data or not means the excel file is empty or not.is there any method in the api to fulfill my requirement.i dont't know how to do this.

please help me on this topic.

Thanking You,




Thanks for considering Aspose.

Well, I think you may try to do your own code looping through all the data cells in a worksheet to check whether all the cells are null or have some types of data. You may use cells.getCell(row,col).getValue() method for your need. Alternatively, you may also utilize Cells.getMaxDataRow() and Cells.MaxDataColumn() method for your need. Both methods will return "-1" if there is no data at all in the worksheet.

Thank you.