Switching generation to XLSB format causes custom style issues

Hi all,


I was wondering if anyone else has run into this. I’ve recently upgraded Cells from version 4.9.2 to the latest version 5.2.2. The sole purpose behind upgrading is to start generating Excel files as .xlsb to reduce file size.

I have code that has been successfully generating the .xlsx files for about 8 months. This code does quite a bit of custom style generation and sets various worksheet/workbook protection levels.

The steps I followed to upgrade to 5.2.2 are as follows:
  • Swap out the Cells DLL
  • Fix any breaking API changes (there were only 2, unrelated to style generation)
  • Change the file format from Xlsx to Xlsb
  • Run the code to generate the file

Generating in Xlsx still works beautifully. As soon as the file format is changed to .Xlsb, the custom styles go all wonky. Check out the two screen shots:

  • Generating as FileFormatType.Xlsx: http://screencast.com/t/i5mYYaMVvxiB
  • Generating as FileFormatType.Xlsb: http://screencast.com/t/DXGJwLbZ6P

Also notice how in the Xlsb version the style section is grayed out. It’s completely unselectable. In addition, the following issues exist in the .xlsb version (not an issue in .xlsx):

  • The cells are not selectable, at all. If I unprotect the .xlsb, I can select cells again.
  • .xlsb loses an embedded reference to a VSTO Excel add-in.

Why would switching the generation format from .xlsx to .xlsb cause these differences? It points to bugs in the .xlsb generation bits, but it could also be that I need to change how I call the API.

Any help is most appreciated.

Thanks!
Jim

Hi Jim,

Most probably, it is a bug in Aspose.Cells for .NET. The reason being is that everything is done inside Aspose.Cells.Workbook and it is only when save is called, it is converted into different file formats.

Please create some simple application and post here. I will log it as a bug. Please also give a try to the latest version of Aspose.Cells for .NET 5.2.2.3.

Hello Shakeel,


I tried the latest version, 5.2.2.4. Looks like this version has the same problem. To re-iterate the issues, when saving as .xlsb:

  • Certain styles lose their colors
  • WB protection functions differently (nothing is selectable)
  • Custom worksheet properties are missing

The attached program represents about 95% of the generation functionality I am using. It generates two workbooks, one in .xlsx and one in .xlsb. You should be able to clearly see the difference in the two versions when opening.

To check the extended properties, I opened each file, unprotected the workbook, then opened each using 7zip. In the docProps folder, the .xlsx contains the custom.xml file with the add-in properties, while the .xlsb does not.

I haven’t yet tried reading a generated .xlsb and extracting data. I’ll be testing this next. If I find any differences I will post them here.

Thanks for your help!
Jim

Hi Jim,

Thanks for application. I have logged this bug as CELLSNET-24475.

Hi,

Please try the Aspose.Cells for .NET 5.2.2.6. We have fixed the issue you mentioned.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Aspose team:

Downloaded and tested your latest release. So far it's looking really good. Thanks much for the quick turn! If I run into any additional issues I will let you know.

Thx!
Jim