File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Pivot Charts/Create Pivot Chart/.NET/Create Pivot Chart/Create Pivot Chart Expand file tree Collapse file tree 1 file changed +2
-8
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 ) ;
14+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) ) ;
1615 IWorksheet worksheet = workbook . Worksheets [ 1 ] ;
1716 IPivotTable pivotTable = worksheet . PivotTables [ 0 ] ;
1817
@@ -34,13 +33,8 @@ static void Main(string[] args)
3433
3534 #region Save
3635 //Saving the workbook
37- FileStream outputStream = new FileStream ( Path . GetFullPath ( "Output/PivotChart.xlsx" ) , FileMode . Create , FileAccess . Write ) ;
38- workbook . SaveAs ( outputStream ) ;
36+ workbook . SaveAs ( Path . GetFullPath ( "Output/PivotChart.xlsx" ) ) ;
3937 #endregion
40-
41- //Dispose streams
42- outputStream . Dispose ( ) ;
43- inputStream . Dispose ( ) ;
4438 }
4539 }
4640 }
You can’t perform that action at this time.
0 commit comments