Piotr Czajkowski 2 settimane fa
parent
commit
c4002192fc
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      ExcelORM/ExcelORM/ExcelWriter.cs

+ 5 - 1
ExcelORM/ExcelORM/ExcelWriter.cs

@@ -83,7 +83,11 @@ public class ExcelWriter : IDisposable
         List<Mapping>? mapping = [];
 
         var lastRow = worksheet.LastRowUsed();
-        if (lastRow == null) append = false;
+        if (lastRow == null)
+        {
+            append = false;
+            lastRow = worksheet.FirstRow();
+        }
         
         var rowIndex = (append, startFrom) switch
         {