CustomDocumentProperties and BuiltInDocumentProperties not working?

Hello,

we are currently testing Aspose Cells and need to read CustomDocumentProperties from an Excel-File (97 up to version 2007) but it doesn’t seem to work. We also tried BuiltInDocumentProperties to read the ‘Category’ of an Excel file but this also returns an empty value. To be sure our file is not corrupt we’ve created an empty document and added a CustomDocumentProperty ‘Language’ and filled it with value ‘DE’ and set the BuiltInDocumentProperty ‘Category’ to ‘DE’ too - But none of the 2 settings could be read.

Can anyone help me? Has this something todo with the evaluation version?
Everything else seems to work well, but without this we cant buy ASPOSE Cells.

ASPOSE Cells Version: 4.8.0.0

Thank you!
Jens


Hi Jens,

Thank you for considering Aspose.

Well, Aspose.Cells does supports to Add/retrieve the BuiltIn & Custom Document Properties. Following is my sample code which works fine with the attached latest version of Aspose.Cells and your provided template file.

//Instantiate a Workbook object by calling its empty constructor

Workbook workbook = new Workbook();

//Open and Excel file by calling the Open method of the Workbook object

workbook.Open("C:\\Test.xlsx",FileFormatType.Excel2007Xlsx);

//Retrieve a list of all custom document properties of the Excel file

Aspose.Cells.DocumentProperties customProperties = workbook.Worksheets.CustomDocumentProperties;

//Accessng a custom document property by using the property index

DocumentProperty customProperty1 = customProperties[0];

MessageBox.Show(customProperty1.Name);

Please see the following documentation link to your reference containing the sample codes and details for your need.

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/managing-document-properties.html

If you still face any problem with the attached latest version, please share your complete code. We will check it soon.

Thank You & Best Regards,

Strange, I’ve used workbook.LoadData(filename). This way it doesnt work.
Workbook.Open(filename) seems to work :slight_smile:

Why isn’t workbook.LoadData(filename) working?

Thanks!
Jens

Sorry, should have read the documentation before:

This method only loads data , formulas and formattings from an Excel
file. Other contents and settings are all discarded. It runs faster and
utilize less memory than Open method so it’s better to be used for applications which only need to process data in Excel file.

Thank you very much!
Jens

Hi Jens,

Thanks for your exploration.

Your understanding is correct, Have a good day!