Looly 6 years ago
parent
commit
df96ef1a29
1 changed files with 1 additions and 4 deletions
  1. 1 4
      hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java

+ 1 - 4
hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java

@@ -117,10 +117,7 @@ public class ExcelBase<T extends ExcelBase<T>> implements Closeable {
 	 */
 	@SuppressWarnings("unchecked")
 	public T setSheet(String sheetName) {
-		this.sheet = this.workbook.getSheet(sheetName);
-		if (null == this.sheet) {
-			this.sheet = this.workbook.createSheet(sheetName);
-		}
+		WorkbookUtil.getOrCreateSheet(this.workbook, sheetName);
 		return (T) this;
 	}