Prroblem copying worksheet containing checkboxes

Oct 20, 2014 at 12:38 PM
Hi,
I have a problem copying one worksheet to another. The problem is related to my checkbox controls in my worksheet.
This is what I am trying to do and it works fine when I remove my checkboxes from the excel worksheet.
            FileInfo file = new FileInfo(@"C:\File1.xlsx");
            FileInfo file2 = new FileInfo(@"C:\File2.xlsx");

            ExcelPackage p = new ExcelPackage(file);
            ExcelPackage p2 = new ExcelPackage(file2);

            p.Workbook.Worksheets.Add("newWorkSheet",p2.Workbook.Worksheets[1]);

            Stream s = File.Create(@"C:\File3.xlsx");

            p.SaveAs(s);
This is the error I get when I keep my checkboxes:
OjbectDisposedException was unhandled, It is not possible to reach a closed data stream.

Is it possible to copy a worksheet with these type of controls?