I have an excel workbook with many, many sheets. I want to delete all the sheets except for three of them.
Specifically, i would like to know if there is a way to re
xlApp.DisplayAlerts = false; for (int i = xlApp.ActiveWorkbook.Worksheets.Count; i > 0 ; i--) { Worksheet wkSheet = (Worksheet)xlApp.ActiveWorkbook.Worksheets[i]; if (wkSheet.Name == "NameOfSheetToDelete") { wkSheet.Delete(); } } xlApp.DisplayAlerts = true;