Manage Microsoft® Excel File Metadata via Java

View, add, update, delete or extract custom and built-in Excel file properties using server side Java APIs.

 

Java Excel API supports the management of built-in (system-defined) properties such as title, author name, document statistics etc as well as custom (user-defined) properties in the form of name/value pair. There is Workbook class to load the files, and WorksheetCollection deals with collection of worksheets as well as Worksheet class for representing single worksheet. For accessing builtin and custom properties, BuiltInDocumentProperties, CustomDocumentProperties makes the process simple for metadata management.

Managing System Defined Properties

For managing built-in properties, API provides BuiltInDocumentProperties , and programmers can easily access a built-in property and update its value. Depending on application requirement, developers can use the index or property name from the DocumentPropertyCollection .

Java Code to Manage System Defined Properties
 

Add and Remove Custom Defined Metadata

For handling custom properties, API provides CustomDocumentProperties , and developers can easily access existing properties as well as add new properties using add method of CustomDocumentPropertyCollection class adds the property and returns a reference for the new property as an Properties.DocumentProperty object. DocumentProperty class is used to retrieve the name, value, and type of the document property as DocumentProperty.Name , DocumentProperty.Value , DocumentProperty.Type that returns one of the PropertyType enumeration values.

Java Code to Add Metadata in Excel File
Java Code to Delete Custom Property in Excel File