diff --git a/source/detail/xlsx_producer.cpp b/source/detail/xlsx_producer.cpp index c2e36ca1..f6e51823 100644 --- a/source/detail/xlsx_producer.cpp +++ b/source/detail/xlsx_producer.cpp @@ -1631,7 +1631,7 @@ void xlsx_producer::write_worksheet(const relationship &rel, pugi::xml_node root sheet_view_node.append_attribute("tabSelected").set_value("1"); sheet_view_node.append_attribute("workbookViewId").set_value("0"); - if (!view.get_selections().empty()) + if (!view.get_selections().empty() && !ws.has_frozen_panes()) { auto selection_node = sheet_view_node.child("selection") ? sheet_view_node.child("selection") diff --git a/source/workbook/tests/test_produce_xlsx.hpp b/source/workbook/tests/test_produce_xlsx.hpp index ffd5148d..14eea992 100644 --- a/source/workbook/tests/test_produce_xlsx.hpp +++ b/source/workbook/tests/test_produce_xlsx.hpp @@ -119,7 +119,7 @@ public: ws.get_cell("A22").set_value("timedelta"); ws.get_cell("B22").set_value(xlnt::timedelta(1, 2, 3, 4, 5)); - //ws.freeze_panes("B2"); + ws.freeze_panes("B2"); wb.save("simple.xlsx"); }