For all columns and all rows. Please accept the answer if it's correct
try
{
xlWorkBook = xlApp.Workbooks.Open(filePath, 0, true, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", true, false, 0, true, 0);
Microsoft.Office.Interop.Excel.Worksheet worksheet1 = (Microsoft.Office.Interop.Excel.Worksheet)xlApp.Worksheets["Sheet1"];
int sheet1LastRowCount = worksheet1.UsedRange.Rows.Count;
int _val=0;
for (int i = 2; i <=sheet1LastRowCount; i++)
{
for(int j=1;j<=worksheet1.UsedRange.Columns.Count;j++)
{
if( Int32.TryParse(Convert.ToString(worksheet1.Cells[i,j].Value2),out _val))
{
if (Convert.ToInt32(_val) == 0)
{
Console.WriteLine("Value is equal to 0 in row " + i + " and column " + j);
}
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
xlApp.Quit();
}