Hi there,
I would like to do a very simple things in aspose such as sheet protection and here are my snipped code:
License license = new License();
license.setLicense("/home/tpadmin/workspace-trunk/mb/MatchBox-Platform/src/main/resources/licenses/aspose.cells.lic");
Workbook workbook = new Workbook("/tmp/MyTest.xls", new LoadOptions(LoadFormat.EXCEL_97_TO_2003));
workbook.getWorksheets().get(“Sheet1”).getProtection().setPassword(“123”);
workbook.getWorksheets().get(“Sheet2”).getProtection().setPassword(“123”);
workbook.save("/tmp/result.xls", new XlsSaveOptions(SaveFormat.EXCEL_97_TO_2003));
and then, I opened result.xls in Excel 2010 however, the sheet is not protected at all. Please let me know if I do something wrong in here?
I am using Java AsposeCells 7.0.4
Cheers.