We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We have the situation that we want to fill an excel template that has several worksheets. Is there a better way to do this instead of:
using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(templateFile, outputFileTmp)) { fastExcel.Write(worksheet1, "sheet1", 1); } using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(new FileInfo(outputPathTmp), outputFile)) { fastExcel.Write(worksheet2, "sheet2", 1); } File.Delete(outputPathTmp);
The text was updated successfully, but these errors were encountered:
I haven't tested this but this should work
using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(templateFile, outputFileTmp)) { fastExcel.Write(worksheet1, "sheet1", 1); fastExcel.Write(worksheet2, "sheet2", 1); } File.Delete(outputPathTmp);
Sorry, something went wrong.
@mrjono1 yeah, it would be nice if this solution would work (that was also my first idea), but I'll get an error then:
System.Exception: 'Could not copy template to output file path' IOException: The file '{...}' already exists.
Currently you have to reopen the file as a workaround.
using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(templateFile, outputFileTmp)) { fastExcel.Write(worksheet1, "sheet1", 1); } using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(outputFileTmp)) { fastExcel.Write(worksheet2, "sheet2", 1); }
No branches or pull requests
We have the situation that we want to fill an excel template that has several worksheets. Is there a better way to do this instead of:
The text was updated successfully, but these errors were encountered: