We are facing one issue while saving the excel file by using save method from “com.aspose.cells.Workbook”.
Workbook inputExcel = new Workbook(path);
inputExcel .save(inputExcel .getFileName());
Please find the sample excel for your reference. Please let us know what is root cause for issue. issue
java.lang.NullPointerException: Cannot invoke “String.length()” because “” is null
at com.aspose.cells.q6m.a(Unknown Source)
at com.aspose.cells.q6m.a(Unknown Source)
at com.aspose.cells.l9h.a(Unknown Source)
at com.aspose.cells.x8.a(Unknown Source)
at com.aspose.cells.x8.d(Unknown Source)
at com.aspose.cells.x8.a(Unknown Source)
at com.aspose.cells.e6s.a_(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
It seems you are encountering a NullPointerException while trying to save an Excel file using Aspose.Cells for Java. This issue can arise due to various reasons, including problems with the workbook or the environment in which the code is running.
Here are some steps you can take to troubleshoot and potentially resolve the issue:
Isolate the Problem: Create a simplified, standalone Java program that only uses Aspose.Cells APIs. This will help you determine if the issue is related to Aspose.Cells or if it is caused by other libraries or dependencies in your project.
Check for Null References: Ensure that all objects you are using (like the Workbook instance) are properly initialized and not null before calling methods on them.
Review the Environment: If the code works locally but fails in a cloud environment, check for differences in the environment settings, such as memory allocation or library versions.
Update Aspose.Cells: Make sure you are using the latest version of Aspose.Cells. Sometimes, issues are resolved in newer releases, so updating might fix the problem.
Memory Settings: If your application is set to use MEMORY_PREFERENCE, try switching to NORMAL mode to see if that resolves the issue.
If you continue to face difficulties, consider sharing a runnable sample program that can be compiled and executed without any missing references. This will allow others to assist you more effectively.
For further assistance, you may want to refer to similar discussions in the forum where users have faced similar issues. They often provide insights or solutions that could be relevant to your situation.
@forasposeissues
By testing on the latest version v24.12 using sample file and code, we can reproduce the issue. Found that NullPointerException occurs when resaving file.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSJAVA-46230
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
We are pleased to inform you that your issue(Ticket ID: “CELLSJAVA-46230”) has been resolved. The fix will be included in our upcoming release (Aspose.Cells for Java v25.2) that we plan to release in the first half of February 2025. You will be notified when the next version is released.
I apologize for the misunderstanding. What I intended to convey was that the fix will be part of our next release (Aspose.Cells for Java v25.2), which we aim to launch in the first half of February 2025. I’ve updated/corrected the previous post accordingly. Please stay tuned for the upcoming (Java) release.
@forasposeissues
Do you want to access all the cells in the worksheet? You can implement the requirements through iterators. Please refer to the following document.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.