Hi team!
I am using Aspose cells for Java, and when calling the method isLicensed I am always getting false, even after I set my license correctly.
Here is my code sample:
public class Main {
public static void main(String[] args) throws Exception
{
//Workbook wbk = SaveFileWithLicense();
Workbook wbk = SaveFileWithoutLicense();
if (!wbk.isLicensed())
{
throw new Exception("The Aspose Cells license is quietly failing, and we're now running an evaluation version");
}
}
public static Workbook SaveFileWithLicense() throws Exception
{
com.aspose.cells.License license = new com.aspose.cells.License();
license.setLicense("C:\\MyPath\\Aspose.Cells.Java.lic");
Workbook wbk = new Workbook("C:\\MyPath\\SampleExcelFile.xlsx");
wbk.save("C:\\MyPath\\output_with_license.xlsx");
return wbk;
}
public static Workbook SaveFileWithoutLicense() throws Exception
{
Workbook wbk = new Workbook("C:\\MyPath\\SampleExcelFile.xlsx");
wbk.save("C:\\MyPath\\output_without_license.xlsx");
return wbk;
}
}
resources.zip (13.4 KB)
I always run one method at a time. I know the license works because of the output files, but the method is not working properly.
Please help me if I am using the method incorrectly.