You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: