diff --git a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java index 9a07d353..c1f89f02 100644 --- a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java @@ -164,7 +164,7 @@ public class WriteContextImpl implements WriteContext { try { if (writeSheetHolder.getSheetNo() != null) { // When the add default sort order of appearance - if (WriteTypeEnum.ADD.equals(writeType)) { + if (WriteTypeEnum.ADD.equals(writeType) && writeWorkbookHolder.getTempTemplateInputStream() == null) { currentSheet = createSheet(); } else { currentSheet = writeWorkbookHolder.getWorkbook().getSheetAt(writeSheetHolder.getSheetNo());