Freeze panes when writing an XLS file
See original GitHub issueHas anyone figured out how to freeze panes using this library? I tried many things and always get the message that the Excel file is partly unreadable and needs to be repaired.
The XML I am adding looks like this:
<sheetViews>
<sheetView tabSelected="1" workbookViewId="0">
<pane xSplit="1" ySplit="1" topLeftCell="B2" activePane="bottomRight" state="frozen" />
<selection pane="topRight" activeCell="B1" sqref="B1" />
<selection pane="bottomLeft" activeCell="A2" sqref="A2" />
<selection pane="bottomRight" activeCell="B2" sqref="B2" />
</sheetView>
</sheetViews>
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Excel: Freezing Panes and View Options - GCF Global
Select the row below the row(s) you want to freeze. In our example, we want to freeze rows 1 and 2, so we'll...
Read more >Freeze Panes In Excel With Example - Simplilearn
1. In the windows group, go to the View tab, and click Freeze Panes. Click Freeze Top Row. 2. Go to View >...
Read more >How to Freeze Rows and Columns in Excel to Lock in Place
On the Microsoft Excel Ribbon, click the View tab · To see the Freeze Pane options, click the arrow on the Freeze Panes...
Read more >Set freeze panes in Excel document in C#, VB.NET - Syncfusion
Rows and columns in an Excel document can be frozen by using the FreezePanes() method of IRange interface. To freeze the rows or...
Read more >Excel - Freeze panes to lock rows and columns
To keep an area of a worksheet visible while you scroll to another area of the worksheet, go to the View tab, where...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could anyone share a ready JavaScript code which freezes a pane?
@nmalancea @shapiromatron Feature requests like this are tricky because it first involves understanding the feature and how it is represented in the actual raw formats. Let’s focus on XLSX for the moment.
Based on some testing, I think Excel XLSX cares about where the
sheetViews
appears in the XML file. To test this, I saved a file with a freeze pane, then just moved thesheetViews
block around the file. If the sheetViews block appears just after thedimension
tag then the file is valid, but moving the block anywhere else in the sheet file causes issues.This is consistent with other formats too –
MS-XLSB
worksheet binary format expects the view information to appear after the dimension record.For example, in the XML this works:
This does not work:
(the difference is the relative location of the
sheetFormatPr
)@nmalancea can you check if putting the
sheetViews
block directly after thedimension
tag fixes the issue?