try
{
FileInfo resultFile = new FileInfo(@"C:\\Users\\350154\\Desktop\\vb workouts\\testsample.xlsx");
if (resultFile.Exists)
{
resultFile.Delete();
}
ExcelPackage masterPackage = new ExcelPackage(new FileInfo(@"C:\\Users\\350154\\Desktop\\vb workouts\\testsample.xlsx"));
ExcelPackage pckg = new ExcelPackage(new FileInfo(@"C:\\Users\\350154\\Desktop\\vb workouts\\y.xlsx"));
string workSheetName = pckg.Workbook.Worksheets[1].Name;
masterPackage.Workbook.Worksheets.Add(workSheetName, pckg.Workbook.Worksheets[1]);
masterPackage.Workbook.Worksheets.Add("test");
masterPackage.SaveAs(new FileInfo(@"C:\\Users\\350154\\Desktop\\vb workouts\\testsample.xlsx"));
}catch(excption e){
console.writeline();
}
嗨,我正在使用Epplus将工作表从工作簿复制到新工作簿并创建为工作表。我的代码在上面。我正在使用Epplus4.0。但是我无法处理我的代码。出现错误:保存文件时出错 请帮我解决我的问题。