Last active
July 8, 2024 18:12
-
-
Save aspose-com-kb/96c01e2256da043b33d750a30e939d4d to your computer and use it in GitHub Desktop.
Freeze Panes in Excel with Java. For further details: https://kb.aspose.com/cells/java/freeze-panes-in-excel-with-java/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.aspose.cells.*; | |
public class Main | |
{ | |
public static void main(String[] args) throws Exception // Freeze panes in Excel | |
{ | |
// Set the licenses | |
new License().setLicense("License.lic"); | |
// Instantiate a new Workbook. | |
Workbook workbook = new Workbook("Sample.xlsx"); | |
// Freezing panes at th cell G7 | |
workbook.getWorksheets().get(0).freezePanes(6,6, 2, 3); | |
//workbook.getWorksheets().get(0).unFreezePanes(); | |
// Saving the file | |
workbook.save("frozen.xlsx"); | |
System.out.println("Rows and columns freezed successfully"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment