File tree Expand file tree Collapse file tree 2 files changed +5
-26
lines changed
Add Custom XML/.NET/Add Custom XML/Add Custom XML
Read Custom XML/.NET/Read Custom XML/Read Custom XML Expand file tree Collapse file tree 2 files changed +5
-26
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,10 @@ static void Main(string[] args)
2424
2525 #region Save
2626 //Saving the workbook
27- FileStream outputStream = new FileStream ( Path . GetFullPath ( "Output/CreateCustomXML.xlsx" ) , FileMode . Create , FileAccess . Write ) ;
28- workbook . SaveAs ( outputStream ) ;
27+ workbook . SaveAs ( Path . GetFullPath ( "Output/CreateCustomXML.xlsx" ) ) ;
2928 #endregion
30-
31- //Dispose streams
32- outputStream . Dispose ( ) ;
33-
3429 //Open default JSON
3530 }
3631 }
3732 }
38- }
39-
40-
41-
42-
43-
33+ }
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ static void Main(string[] args)
1212 {
1313 IApplication application = excelEngine . Excel ;
1414 application . DefaultVersion = ExcelVersion . Xlsx ;
15- FileStream inputStream = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) , FileMode . Open , FileAccess . Read ) ;
16- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
15+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) , ExcelOpenType . Automatic ) ;
1716 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
1817
1918 //Access CustomXmlPart from Workbook
@@ -26,19 +25,9 @@ static void Main(string[] args)
2625
2726 #region Save
2827 //Saving the workbook
29- FileStream outputStream = new FileStream ( Path . GetFullPath ( "Output/ReadXml.xlsx" ) , FileMode . Create , FileAccess . Write ) ;
30- workbook . SaveAs ( outputStream ) ;
28+ workbook . SaveAs ( Path . GetFullPath ( "Output/ReadXml.xlsx" ) ) ;
3129 #endregion
32-
33- //Dispose streams
34- outputStream . Dispose ( ) ;
35- inputStream . Dispose ( ) ;
3630 }
3731 }
3832 }
39- }
40-
41-
42-
43-
44-
33+ }
You can’t perform that action at this time.
0 commit comments