I want to check if a row beside the header row is empty in a spreadsheet. If it's empty, I want to delete the sheet. So far I can only get it to look at cell A2 and check if it empty, but is there a way to check the entire row?
Thanks
private void CheckForEmptyRow(WorkbookPart wbp, string sheetId)
{
Sheet sheet = wbp.Workbook.Descendants<Sheet>().FirstOrDefault(s => s.Id == sheetId);
WorksheetPart wsp = (WorksheetPart).(wbp.GetPartById(sheetId));
Cell cell = wsp.Worksheet.Descendants<Cell>().Where(c => c.CellReference == "A2").FirstOrDefault();
If (cell == null)
{
sheet.Remove();
wbp.DeletePart(wsp);
}
}