Skip to content

Commit 2e86692

Browse files
committed
Update ExcelHelper.java
1 parent 0fef433 commit 2e86692

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/anhtester/helpers/ExcelHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public void setExcelFile(String ExcelPath, String SheetName) {
3434
fis = new FileInputStream(ExcelPath);
3535
wb = WorkbookFactory.create(fis);
3636
sh = wb.getSheet(SheetName);
37-
//sh = wb.getSheetAt(0); //0 - index of 1st sheet
37+
3838
if (sh == null) {
39-
sh = wb.createSheet(SheetName);
39+
throw new Exception("Sheet name doesn't exist.");
4040
}
4141

4242
this.excelFilePath = ExcelPath;

0 commit comments

Comments
 (0)