I want to copy two sheets from each excel in a folder to the same word doc one after the other. I am using insert datatable in document activity. I would like the second sheet to start in a new page instead of right after the first one. Is there a way to do it?
Also, is there a way to select sheets in excel application scope that contains a keyword? For example, sheet name containing “projects” or “PROJECTS”?
you can get all the sheet names:
Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook excelBook = xlApp.Workbooks.Open(“D:\Book1.xlsx”);
String excelSheets = new String[excelBook.Worksheets.Count];
int i = 0;
foreach(Microsoft.Office.Interop.Excel.Worksheet wSheet in excelBook.Worksheets)
excelSheets[i] = wSheet.Name;
then you can have a check weather that contains a specific text or not.