-1

iterating through all sheets in workbook using openxml(C#) but want to skip a specific sheet based on its name.Please suggest how it can be done.

Kush
  • 11
  • 1
  • condition for sheet name in your loop: if (sheet.Name != "not me") – tinamou May 17 '17 at 10:41
  • 1
    what did you try? anything? show the code, explain what issue you specifically have – BugFinder May 17 '17 at 10:42
  • i have a task to compare 2 excel sheets.Here i am taking data into a datatable. My all sheets have values starting from row 2 (A2)so i have set a condition according to that,except 1 sheet which is the first sheet. this sheet is not matching the condition ==> if (row.RowIndex.Value == 2) – Kush May 17 '17 at 10:49

1 Answers1

0

The sheet names are stored in the WorkbookPart in a Sheets element which has children of element Sheet which corresponds to each worksheet in the Excel file.

See the answer given in this question. Make your own loop and skip the sheet according to its name.

Community
  • 1
  • 1