From 1217b7d40a0589abb291849ea9cb6670c028c1d2 Mon Sep 17 00:00:00 2001 From: MOHAN CHANDRAN <93247949+Mohan2401@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:05:37 +0530 Subject: [PATCH] Update README.md --- .../Console/.NET/Create Excel/Create Excel/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Getting Started/Console/.NET/Create Excel/Create Excel/README.md b/Getting Started/Console/.NET/Create Excel/Create Excel/README.md index 8cd73bcc..08607bd7 100644 --- a/Getting Started/Console/.NET/Create Excel/Create Excel/README.md +++ b/Getting Started/Console/.NET/Create Excel/Create Excel/README.md @@ -193,9 +193,12 @@ using (ExcelEngine excelEngine = new ExcelEngine()) worksheet.Range["A15:A23"].RowHeight = 18; //Saving the Excel to the Stream - FileStream stream = new FileStream(Path.GetFullPath(@"Output/Output.xlsx"), FileMode.Create, FileAccess.Write); - workbook.SaveAs(stream); + using (FileStream stream = new FileStream(Path.GetFullPath(@"Output/Output.xlsx"), FileMode.Create, FileAccess.Write)) + { + workbook.SaveAs(stream); + } + imageStream.Dispose(); } ``` -More information about creating an Excel document can be found in this [documentation](https://help.syncfusion.com/document-processing/excel/excel-library/net/create-excel-files-in-console-apps-c-sharp) section. \ No newline at end of file +More information about creating an Excel document can be found in this [documentation](https://help.syncfusion.com/document-processing/excel/excel-library/net/create-excel-files-in-console-apps-c-sharp) section.