Soffice ignoring freeze panes when converting file from SpreadsheetML to XLSX

Hello, first-time poster and first-time Libreoffice user, so please bear with me.

Long story short: When I attempt to convert a SpreadsheetML file to XLSX the freeze pane doesn’t get carried over. This is the command I’m using:

soffice --headless --infilter="MS Excel 2003 XML" --convert-to xlsx origfile.xml

Long story long: I have a Perl application that programmatically generates Excel 2003 SpreadsheetML files from database results. This method has always worked fine, but due to a change in requirements I am now being asked to provide the files in XLSX format instead of XML/XLS. Rather than completely rewrite the process to use something like Excel::Writer::XLSX, I would like to be able to create the files the same way as before and just convert them to XLSX programmatically. Libreoffice (soffice specifically) does everything I want it to… with that one unfortunate exception.

Here are the relevant lines from the XML/XLS file. If it’s just a matter of changing/adding lines in this section, that’s perfectly fine:

  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Selected/>
   <FreezePanes/>
   <FrozenNoSplit/>
   <SplitHorizontal>1</SplitHorizontal>
   <TopRowBottomPane>1</TopRowBottomPane>
   <ActivePane>2</ActivePane>
   <Panes>
    <Pane>
     <Number>3</Number>
    </Pane>
    <Pane>
     <Number>2</Number>
     <ActiveRow>0</ActiveRow>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>

Can someone assist?

Did you try to just open the XMLs in LibreOffice, and check if the property is supported in the import filter? If it’s unsupported, you are welcome to file a bug report; and also to look at the import filter implementation - which is an XSLT - so you could even fix that yourself and improve it for everybody.

Thanks for the reply, Mike. I see a definition for FreezePanes in that XSLT. I also just noticed that my version of LibreOffice is ridiculously old. I installed it from the default repo in the most recent release of RHEL, so I figured it wouldn’t be the absolute newest version but I also didn’t expect it to be so far behind.

Note that there was a version scheme change ~recently, so after v7.6 immediately goes v.24.2 :slight_smile:

Ah, good to know!

Moving to the newest version of LibreOffice solved the issue. Thanks all!

1 Like