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

Free Support Forum - aspose.com

Opening Office 2003 Workbook ignores Worksheet Custom Properties with large values

Hello,

We have encountered a problem when working with Excel 2003 workbooks involving large Worksheet Custom Property values, this is working fine when using Excel 2007 workbooks:

These are the steps to reproduce:
1. Using Ms Office create an Excel 2003 Spreadsheet
2. Add to the worksheet “Sheet1” a custom property (using VBA) and save:
ActiveSheet.CustomProperties.Add Name:=“VeryLongString”, Value:="the long string value…"
Note: The value string should be greater than 4500 characters.
Ms Office Excel saves the value correctly inside the .xls file.
3. Using Aspose.Cells open the spreadsheet:
var workbook = new Workbook(path);
4. Check for the existence of the custom property on the worksheet Sheet1:
var customPropery = workbook.Worksheets[“Sheet1”].CustomProperties[“VeryLongString”];
You will notice that the customPropery is null.

This also impacts the Save functionality, saving the above workbook will not include the custom property.

We are using Aspose.Cells version 7.1.0.0.

Thank you in advance,
Bogdan Rusu.

Hi,


Could you attach your sample template Excel file (containing the custom property “VeryLongString”), we will check your issue soon.

As a side note, could you try our latest version v7.1.2 if it makes any difference:
http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry367730.aspx

Thank you.

Hello,

Thank you for the reply, I’ve attached the .xls file as zip archive.

I will also try the latest version of Aspose.Cells and keep you posted.

Thank you,
Bogdan Rusu.

Hi,


Well, since your custom property is added via a macro which should be run when opening the file into MS Excel, so I am afraid Aspose.Cells might skip these types of custom properties. The reason is simple, Aspose.Cells does not support to run or execute or add macros or vba codes. The product only supports to preserve macros while loading the file or saving/saving as the files. We have already logged this feature request. But we cannot implement macros feature in near future. This issue has been logged as CELLSNET-40470.

Also, if you could add your custom property via Aspose.Cells APIs or using MS Excel options e.g Office Button|Prepare| Properties (without using macros/vba codes), the product would retrieve those properties fine.

Sorry for any inconvenience caused!

Hello,

In my original post I was reffreing to the “Worksheet Custom Properties”, these properties are added programmatically (via macros/VBA, 3rd party Excel addins, etc.) and their values are static once added.
These are accessed from code using Aspose.Cells in the following way:

var workbook = new Workbook(path);
var customPropery = workbook.Worksheets[“Sheet1”].CustomProperties[“customPropertyName”];

‘customPropery’ will reference the CustomProperty named “customPropertyName” from the worksheet “Sheet1” inside the workbook.


Your last reply is reffering to “Office Button|Prepare|Properties” which is a different thing, these are Workbook-level properties.
These are accessed from code using Aspose.Cells in the following way:

var workbook = new Workbook(path);
var properties = workbook.BuiltInDocumentProperties;

‘properties’ will reference the Workbook-level properties.

Regarding your comment “custom property is added via a macro which should be run when opening the file into MS Excel” I must point that no macro is required to be run for the attached Excel document, it already contains the custom property on the “Sheet1”.
I have attached a new version of the Excel workbook this time containing no macros, it already contains the Custom Property named “VeryLongString” on worksheet “Sheet1”.

I have also verified using the latest version of Aspose.Cells, version 7.1.2, but the problem persists.

To summarize the conclusion is that Aspose.Cells should not remove existing large Worksheet Custom Properties for Excel 2003 workbooks as it does with Excel 2007 workbooks.


Thank you,
Bogdan Rusu.

Hi,


Thanks for more details with sample file and sorry for the confusion.

Yes, Aspose.Cells should not remove these types of custom properties. We have found the issue and logged it as an id: " CELLSNET-40470" We will soon look into it to figure it out. Once we fix it we will provide you the fixed version here.

Thanks for your time.

Hello,

Thank you for your help, I’ll be waiting for the fix.

Regards,
Bogdan Rusu.

Hi,

We have fixed this issue. Please download and try this fix: Aspose.Cells for .NET v7.1.2.1

Hi,

Thank you for the fixed version, verified it and works fine.

Another question, I presume that this fix will be persisted to future releases of Aspose.Cells, is that correct?


Regards,
Bogdan Rusu.

Hi,

It’s good to know your problem is resolved now.

Yes, that’s correct. All future releases will contain this fix.

If you get any other question, please feel free to ask. We will help you asap.

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


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

Hi,

Thanks for using Aspose.Cells.

We only plan to create, manipulate or embed VBA codes/ macros later. We however cannot support to run or execute macros. Does it fit your needs?