public override StdExcelWorkSheetBase InsertSheet(string sheetName) { Worksheet sheet = _workbook.Sheets.Add(); sheet.Name = sheetName; StdExcelWorkSheetBase worksheet = new ComWorksheet(sheet); _workSheets.Add(worksheet); return(worksheet); }
protected override void ReadWorkbook(string fileName) { _fileName = fileName; _workbook = _ExcelApp.Workbooks.Open(fileName); foreach (Worksheet sheet in _workbook.Worksheets) { ComWorksheet comWorksheet = new ComWorksheet(sheet); _workSheets.Add(comWorksheet); } //throw new NotImplementedException(); }
public override StdExcelWorkSheetBase GetSheet(string sheetName) { StdExcelWorkSheetBase targetSheet = null; foreach (Worksheet worksheet in _workbook.Worksheets) { if (worksheet.Name.Equals(sheetName, StringComparison.OrdinalIgnoreCase)) { targetSheet = new ComWorksheet(worksheet); } } return(targetSheet); }