08-22-2011, 02:43 PM
Hi Gintaras,
I tested your code with one example file. It copy one sheet but fails in the next ones! The sheet that is selected when you save the original file is copy well but the remain return a RT error:
Error (RT) in ExcelCopySheets: 0x800A03EC, . ?
in the line:
Excel.Worksheet wsNew=wb.Sheets.Item(wb.Sheets.Count); wsNew.Name=name
right before the "...wsNew.Name=..."
I tested your code with one example file. It copy one sheet but fails in the next ones! The sheet that is selected when you save the original file is copy well but the remain return a RT error:
Error (RT) in ExcelCopySheets: 0x800A03EC, . ?
in the line:
Excel.Worksheet wsNew=wb.Sheets.Item(wb.Sheets.Count); wsNew.Name=name
right before the "...wsNew.Name=..."