We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

.XLSB file getting corrupted after saving with aspose API- aspose-cells-8.4.1.jar

Hi,


I am trying to write some content to .XLSB file using aspose java API. I see the file getting corrupted after save and showing repair prompt from Excel.

Tried the following simple program to see whether issue with my data or aspose. Open a work book (which was not corrupted) and just save it using aspose . It is corrupted and prompting to repair and removing some pivot tables.


public static void main(String[] args)
{
try
{
String in=“D:/reports/in/C13_v2.xlsb”;
Workbook workbook= new Workbook(in);
workbook.save(“D:/reports/in/C13_v2_temp.xlsb”,SaveFormat.XLSB);
System.out.println(“Saved”);
}
catch(Exception e)
{
e.printStackTrace();
}
}


Currently we are using aspose-cells-8.4.1.jar . I tried with the latest version (8.5.x) also . Its not working.

I see the similar issue fixed for the below issue.




XLSB corrupted when saved with aspose

I tried aspose-cells-8.3.2.4.jar as mentioned in the above post but it is also not working with the attached XLSB file.


Any idea how to fix this issue?




Hi Chandra,


Thank you for sharing the sample.

We have checked your provided sample, and we believe the said behavior (Excel’s repair warning on Aspose.Cells’ saved spreadsheet) is caused because the Pivot Table in the source spreadsheet was saved without it’s underlying data source. Please check the attached snapshots for the errors that Excel show upon opening your provided XLSB.

Same excel file is working when I converted it to XLSX or XLSM . I am able to write data to it and save using aspose , it is not getting corrupted. I am able to open it properly.


XLSM Code:

String in=“D:/reports/in/C13_v2.xlsm”;
Workbook workbook= new Workbook(in);
workbook.save(“D:/reports/out/C13_v2_temp.xlsm”,SaveFormat.XLSM);


XLSX Code:

String in=“D:/reports/in/C13_v2.xlsx”;
Workbook workbook= new Workbook(in);
workbook.save(“D:/reports/out/C13_v2_temp.xlsx”,SaveFormat.XLSX);





Same should work with XLSB also.
Can you please check what is causing the issue. Because we are using the same template but when I save it as XLSB it is not working from aspose and other formats like XLSX , XLSM with same file ( I have opened the same excel and saved it as XLSX , XLSM and used it to write data) are working.

Hi Chandra,


Please share the referenced XLSX & XLSM files so we could check if these spreadsheet exhibit the same behavior as of XLSB when loaded in Excel application.

File s attached.

I have used the same excel file that is attached earlier in the beginning of this thread. I opened that XLSB file click on ‘Save As’ and selected 'XLSM ( macro enabled work book) from drop down to create XLSM file.

Same method followed to create XLSX also.
I used these file and they worked fine with aspose.


Hi Chandra,


Thank you for sharing more details.

We have converted the spreadsheet manually to XLSX & XLSM file formats and re-saved both using the Aspose.Cells for Java 8.6.0.4. Resultant spreadsheets in this case can be loaded fine with Excel application, however, when same process is executed on XLSB, the resultant spreadsheet is corrupt, and shows repair warnings in Excel application. We have logged this incident in our bug tracking system under the ticket CELLSJAVA-41528 for product team’s review. Please allow us some time to properly evaluate the scenario, and to get back with updates in this regard.

Regarding the problem of uploading samples to forum threads, you may always upload the samples to some free file hosting services such as Dropbox/Google Drive and share the download link here.

Hi,


This is to update you that we have resolved your issue logged earlier as “CELLSJAVA-41528”. We will soon provide the fix after performing QA and incorporating other enhancements and fixes.

Thank you.

Hi,

Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java v8.6.0.7 and let us know your feedback.

Thanks for the fix.

We will try this and share the results.

The issues you have found earlier (filed as CELLSJAVA-41528) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.