File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed
Create Slicer/.NET/Create Slicer/Create Slicer
Edit Slicer/.NET/Edit Slicer/Edit Slicer Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ static void Main(string[] args)
1111 {
1212 IApplication application = excelEngine . Excel ;
1313 application . DefaultVersion = ExcelVersion . Xlsx ;
14- FileStream inputStream = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) , FileMode . Open , FileAccess . Read ) ;
15- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
14+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) , ExcelOpenType . Automatic ) ;
1615 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
1716
1817 //Access the table.
@@ -23,13 +22,8 @@ static void Main(string[] args)
2322
2423 #region Save
2524 //Saving the workbook
26- FileStream outputStream = new FileStream ( Path . GetFullPath ( "Output/CreateSlicer.xlsx" ) , FileMode . Create , FileAccess . Write ) ;
27- workbook . SaveAs ( outputStream ) ;
25+ workbook . SaveAs ( Path . GetFullPath ( "Output/CreateSlicer.xlsx" ) ) ;
2826 #endregion
29-
30- //Dispose streams
31- outputStream . Dispose ( ) ;
32- inputStream . Dispose ( ) ;
3327 }
3428 }
3529 }
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ static void Main(string[] args)
1111 {
1212 IApplication application = excelEngine . Excel ;
1313 application . DefaultVersion = ExcelVersion . Xlsx ;
14- FileStream inputStream = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) , FileMode . Open , FileAccess . Read ) ;
15- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
14+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) , ExcelOpenType . Automatic ) ;
1615 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
1716
1817 //Access the table
@@ -53,13 +52,8 @@ static void Main(string[] args)
5352
5453 #region Save
5554 //Saving the workbook
56- FileStream outputStream = new FileStream ( Path . GetFullPath ( "Output/EditSlicer.xlsx" ) , FileMode . Create , FileAccess . Write ) ;
57- workbook . SaveAs ( outputStream ) ;
55+ workbook . SaveAs ( Path . GetFullPath ( "Output/EditSlicer.xlsx" ) ) ;
5856 #endregion
59-
60- //Dispose streams
61- outputStream . Dispose ( ) ;
62- inputStream . Dispose ( ) ;
6357 }
6458 }
6559 }
You can’t perform that action at this time.
0 commit comments