diff --git a/QXlsx/source/xlsxdocument.cpp b/QXlsx/source/xlsxdocument.cpp index beb4e833..ea277b7e 100644 --- a/QXlsx/source/xlsxdocument.cpp +++ b/QXlsx/source/xlsxdocument.cpp @@ -491,7 +491,7 @@ bool DocumentPrivate::saveCsv(QString mainCSVFileName) const int maxRow = -1; int maxCol = -1; - currentSheet->workbook()->setActiveSheet(sheetIndexNumber); + currentSheet->workbook()->setActiveSheet(sheetIndexNumber++); auto wsheet = static_cast(currentSheet->workbook()->activeSheet()); if (wsheet == nullptr) {