EPPlus
EPPlus copied to clipboard
Can not copy the sheet when the sheet has button.
If the sheet has button. can not use copy a new sheet.
It will raise An unhandled exception of type "System.InvalidOperationException" occurred in EPPlus.dll. The Inner Exception is: Cannot access a closed Stream.
Here is my code.
private void button1_Click(object sender, EventArgs e)
{
FileInfo templateFile = new FileInfo("Original-With-Button.xlsx");
FileInfo newFile = new FileInfo("Copy-With-Button.xlsx");
using (var package = new ExcelPackage(newFile, templateFile))
{
package.Workbook.Worksheets.Copy("Sheet1", "Sheet2");
package.Save();
}
}
If I remove the button in Sheet1, the copy it work right. How can I copy the sheet with button?
I have the same problem, did you solve it?
no. It still has problem.