File tree Expand file tree Collapse file tree 6 files changed +6
-18
lines changed
Clear All Macros/.NET/Clear All Macros/Clear All Macros
Create Macro as MSForm/.NET/Create Macro as MSForm/Create Macro as MSForm
Edit Macro/.NET/Edit Macro/Edit Macro
Remove Macro with Index/.NET/Remove Macro with Index/Remove Macro with Index
Remove Macro with Name/.NET/Remove Macro with Name/Remove Macro with Name
Skip Macro and Save/.NET/Skip Macro and Save/Skip Macro and Save Expand file tree Collapse file tree 6 files changed +6
-18
lines changed 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.xls" ) , FileMode . Open , FileAccess . Read ) ;
16- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
15+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , ExcelOpenType . Automatic ) ;
1716 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
1817
1918 //Accessing Vba project
@@ -32,7 +31,6 @@ static void Main(string[] args)
3231 #endregion
3332
3433 //Dispose streams
35- inputStream . Dispose ( ) ;
3634 outputStream . Dispose ( ) ;
3735 }
3836 }
Original file line number Diff line number Diff line change @@ -23,8 +23,7 @@ static void Main(string[] args)
2323 IVbaModules vbaModules = project . Modules ;
2424
2525 //Opening form module existing workbook
26- FileStream input = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , FileMode . Open , FileAccess . ReadWrite ) ;
27- IWorkbook newBook = application . Workbooks . Open ( input ) ;
26+ IWorkbook newBook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) ) ;
2827
2928 IVbaProject newProject = newBook . VbaProject ;
3029
@@ -47,7 +46,6 @@ static void Main(string[] args)
4746 #endregion
4847
4948 //Dispose streams
50- input . Dispose ( ) ;
5149 outputStream . Dispose ( ) ;
5250 }
5351 }
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ static void Main(string[] args)
1313 {
1414 IApplication application = excelEngine . Excel ;
1515 application . DefaultVersion = ExcelVersion . Xlsx ;
16- FileStream inputStream = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , FileMode . Open , FileAccess . Read ) ;
17- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
16+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , ExcelOpenType . Automatic ) ;
1817 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
1918
2019 //Accessing Vba project
@@ -38,7 +37,6 @@ static void Main(string[] args)
3837 #endregion
3938
4039 //Dispose streams
41- inputStream . Dispose ( ) ;
4240 outputStream . Dispose ( ) ;
4341 }
4442 }
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ static void Main(string[] args)
1313 {
1414 IApplication application = excelEngine . Excel ;
1515 application . DefaultVersion = ExcelVersion . Xlsx ;
16- FileStream inputStream = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , FileMode . Open , FileAccess . Read ) ;
17- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
16+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , ExcelOpenType . Automatic ) ;
1817 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
1918
2019 //Accessing Vba project
@@ -33,7 +32,6 @@ static void Main(string[] args)
3332 #endregion
3433
3534 //Dispose streams
36- inputStream . Dispose ( ) ;
3735 outputStream . Dispose ( ) ;
3836 }
3937 }
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ static void Main(string[] args)
1313 {
1414 IApplication application = excelEngine . Excel ;
1515 application . DefaultVersion = ExcelVersion . Xlsx ;
16- FileStream inputStream = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , FileMode . Open , FileAccess . Read ) ;
17- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
16+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , ExcelOpenType . Automatic ) ;
1817 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
1918
2019 //Accessing Vba project
@@ -33,7 +32,6 @@ static void Main(string[] args)
3332 #endregion
3433
3534 //Dispose streams
36- inputStream . Dispose ( ) ;
3735 outputStream . Dispose ( ) ;
3836 }
3937 }
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ static void Main(string[] args)
1414 {
1515 IApplication application = excelEngine . Excel ;
1616 application . DefaultVersion = ExcelVersion . Xlsx ;
17- FileStream inputStream = new FileStream ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , FileMode . Open , FileAccess . Read ) ;
18- IWorkbook workbook = application . Workbooks . Open ( inputStream , ExcelOpenType . Automatic ) ;
17+ IWorkbook workbook = application . Workbooks . Open ( Path . GetFullPath ( @"Data/InputTemplate.xls" ) , ExcelOpenType . Automatic ) ;
1918 IWorksheet sheet = workbook . Worksheets [ 0 ] ;
2019
2120 //Skip Macros while saving
@@ -28,7 +27,6 @@ static void Main(string[] args)
2827 #endregion
2928
3029 //Dispose streams
31- inputStream . Dispose ( ) ;
3230 outputStream . Dispose ( ) ;
3331 }
3432 }
You can’t perform that action at this time.
0 commit comments