Home » excel » java – How to get information of freeze or split columns in excel while reading using apache poi?

java – How to get information of freeze or split columns in excel while reading using apache poi?

Posted by: admin May 14, 2020 Leave a comment


As i went through apache poi documentation, they say you can get information of freeze or split pane using PanelInformation object in util package. And for that i need object of HSSFSheet class. I am able to get HSSFSHeet object but when I am trying to get PanelInformation from it using getPanelInformation method. It returns me null.

HSSFWorkbook workbook = new HSSFWorkbook(file);
HSSFSheet sheet = workbook.getSheetAt(sheetNumber);
How to&Answers:

See the documentation here:


The method you are looking for I believe is the method getPaneInformation() which will tell you if the pane you are currently looking at is a freeze or split pane.


Returning null is normal behavior for the getPaneInformation method.


null if no pane configured, or the pane information.

This indicates that neither a split pane nor a freeze pane has been set up for your Sheet. If you did create a split pane or a freeze pane, either in the workbook you’re reading, or programmatically with createSplitPane or createFreezePane, then getPaneInformation would return a non-null PaneInformation object.


This question is quite old, so I put this information for the sake of sharing Knowledge.

As written previously, you can find out if some rows are frozen with:


Then, you can get the first index of the non-frozen row with:


According to the Javadoc:

For a horizontal split returns the top row in the BOTTOM pane.

In case of vertical split, one has to use: