From aa06c8a11d3da59b44c9898b8d8bfd8746d849af Mon Sep 17 00:00:00 2001 From: KarthikaSF4773 Date: Mon, 3 Nov 2025 16:46:00 +0530 Subject: [PATCH] 990137-CustomXmlSupport --- .../Excel-Library/NET/Custom-XML-Support.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/Document-Processing/Excel/Excel-Library/NET/Custom-XML-Support.md b/Document-Processing/Excel/Excel-Library/NET/Custom-XML-Support.md index d8cf1e8a4..f072a883a 100644 --- a/Document-Processing/Excel/Excel-Library/NET/Custom-XML-Support.md +++ b/Document-Processing/Excel/Excel-Library/NET/Custom-XML-Support.md @@ -38,13 +38,9 @@ using (ExcelEngine excelEngine = new ExcelEngine()) #region Save //Saving the workbook - FileStream outputStream = new FileStream(Path.GetFullPath("Output/CreateCustomXML.xlsx"), FileMode.Create, FileAccess.Write); - workbook.SaveAs(outputStream); + workbook.SaveAs(Path.GetFullPath("Output/CreateCustomXML.xlsx")); #endregion - //Dispose streams - outputStream.Dispose(); - //Open default JSON } {% endhighlight %} @@ -99,8 +95,7 @@ using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Xlsx; - FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); - IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic); + IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"), ExcelOpenType.Automatic); IWorksheet sheet = workbook.Worksheets[0]; //Access CustomXmlPart from Workbook @@ -113,13 +108,8 @@ using (ExcelEngine excelEngine = new ExcelEngine()) #region Save //Saving the workbook - FileStream outputStream = new FileStream(Path.GetFullPath("Output/ReadXml.xlsx"), FileMode.Create, FileAccess.Write); - workbook.SaveAs(outputStream); + workbook.SaveAs(Path.GetFullPath("Output/ReadXml.xlsx")); #endregion - - //Dispose streams - outputStream.Dispose(); - inputStream.Dispose(); } {% endhighlight %}