private void AddRows(XlWorkbook book, DataTab data) { XlWorksheets sheets = book.Worksheets; List <BaseDTO> list = new List <BaseDTO>(data); XlWorksheet sheet = sheets.AddWorksheet(data.Name, data.Color, data.Schema); int numberRows = list.Count; for (int rowIndex = 0; rowIndex < numberRows; rowIndex++) { Dictionary <string, string> values = list[rowIndex].Values(); sheet.AddRow(rowIndex, values); } }