Example #1
0
 public void CopyWorksheet(int SourceWorksheetIndex, int DesWorksheetIndex)
 {
     try
     {
         Excel.Worksheet sheetSource = (Excel.Worksheet)xlsWb.Worksheets[SourceWorksheetIndex];
         sheetSource.Select(Missing.Value);
         Excel.Worksheet sheetDest = (Excel.Worksheet)xlsWb.Worksheets[DesWorksheetIndex];
         sheetSource.Copy(Missing.Value, sheetDest);
     }
     catch (Exception e)
     {
         CloseExcelApplication();
         throw new Exception(e.Message);
     }
 }