File tree Expand file tree Collapse file tree 6 files changed +8
-27
lines changed 
Add Picture/.NET/Add Picture/Add Picture 
Add SVG Picture/.NET/Add SVG Picture/Add SVG Picture 
External Image/.NET/External Image/External Image 
ImageInMergedRegion/.NET/ImageInMergedRegion/ImageInMergedRegion 
Move and Size with cells/.NET/Move and Size with cells/Move and Size with cells 
Position and Resize Picture/.NET/Position and Resize Picture/Position and Resize Picture Expand file tree Collapse file tree 6 files changed +8
-27
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,10 @@ static void Main(string[] args)
2020
2121                #region Save
2222                //Saving the workbook 
23-                 FileStream  outputStream  =  new  FileStream ( Path . GetFullPath ( "Output/AddPicture.xlsx" ) ,  FileMode . Create ,  FileAccess . Write ) ; 
24-                 workbook . SaveAs ( outputStream ) ; 
23+                 workbook . SaveAs ( Path . GetFullPath ( "Output/AddPicture.xlsx" ) ) ; 
2524                #endregion
2625
2726                //Dispose streams 
28-                 outputStream . Dispose ( ) ; 
2927                imageStream . Dispose ( ) ; 
3028            } 
3129        } 
Original file line number Diff line number Diff line change @@ -22,12 +22,10 @@ static void Main(string[] args)
2222
2323                #region Save
2424                //Saving the workbook 
25-                 FileStream  outputStream  =  new  FileStream ( Path . GetFullPath ( "Output/SVGImage.xlsx" ) ,  FileMode . Create ,  FileAccess . Write ) ; 
26-                 workbook . SaveAs ( outputStream ) ; 
25+                 workbook . SaveAs ( Path . GetFullPath ( "Output/SVGImage.xlsx" ) ) ; 
2726                #endregion
2827
2928                //Dispose streams 
30-                 outputStream . Dispose ( ) ; 
3129                svgStream . Dispose ( ) ; 
3230                pngStream . Dispose ( ) ; 
3331            } 
Original file line number Diff line number Diff line change @@ -19,12 +19,8 @@ static void Main(string[] args)
1919
2020                #region Save
2121                //Saving the workbook 
22-                 FileStream  outputStream  =  new  FileStream ( Path . GetFullPath ( "Output/ExternalImage.xlsx" ) ,  FileMode . Create ,  FileAccess . Write ) ; 
23-                 workbook . SaveAs ( outputStream ) ; 
22+                 workbook . SaveAs ( Path . GetFullPath ( "Output/ExternalImage.xlsx" ) ) ; 
2423                #endregion
25- 
26-                 //Dispose streams 
27-                 outputStream . Dispose ( ) ; 
2824            } 
2925        } 
3026    } 
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 ) ; 
15+                 IWorkbook  workbook  =  application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xlsx" ) ) ; 
1716                IWorksheet  worksheet  =  workbook . Worksheets [ 0 ] ; 
1817
1918                //Get the merged cells 
@@ -42,14 +41,8 @@ static void Main(string[] args)
4241
4342                #region Save
4443                //Saving the workbook 
45-                 FileStream  outputStream  =  new  FileStream ( Path . GetFullPath ( "Output/ImageInMergedRegion.xlsx" ) ,  FileMode . Create ,  FileAccess . Write ) ; 
46-                 workbook . SaveAs ( outputStream ) ; 
44+                 workbook . SaveAs ( Path . GetFullPath ( "Output/ImageInMergedRegion.xlsx" ) ) ; 
4745                #endregion
48- 
49-                 //Dispose streams 
50-                 outputStream . Dispose ( ) ; 
51-                 inputStream . Dispose ( ) ; 
52- 
5346            } 
5447        } 
5548    } 
Original file line number Diff line number Diff line change @@ -28,13 +28,11 @@ public static void Main(string[] args)
2828                //Hide the column 
2929                worksheet . HideColumn ( 5 ) ; 
3030
31-                 //Saving the workbook as stream 
32-                 FileStream  OutputStream  =  new  FileStream ( Path . GetFullPath ( @"Output/Output.xlsx" ) ,  FileMode . Create ,  FileAccess . ReadWrite ) ; 
33-                 workbook . SaveAs ( OutputStream ) ; 
31+                 //Saving the workbook  
32+                 workbook . SaveAs ( Path . GetFullPath ( @"Output/Output.xlsx" ) ) ; 
3433
3534                //Dispose streams 
3635                imageStream . Dispose ( ) ; 
37-                 OutputStream . Dispose ( ) ; 
3836            } 
3937        } 
4038    } 
Original file line number Diff line number Diff line change @@ -28,12 +28,10 @@ static void Main(string[] args)
2828
2929                #region Save
3030                //Saving the workbook 
31-                 FileStream  outputStream  =  new  FileStream ( Path . GetFullPath ( "Output/ResizePicture.xlsx" ) ,  FileMode . Create ,  FileAccess . Write ) ; 
32-                 workbook . SaveAs ( outputStream ) ; 
31+                 workbook . SaveAs ( Path . GetFullPath ( "Output/ResizePicture.xlsx" ) ) ; 
3332                #endregion
3433
3534                //Dispose streams 
36-                 outputStream . Dispose ( ) ; 
3735                imageStream . Dispose ( ) ; 
3836            } 
3937        } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments