Manage Microsoft® Excel File Metadata via .NET

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

 

.NET Excel API supports the management of system-defined (built-in) properties such as title, author name, document statistics etc as well as user-defined (custom) 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. Along with these classes, BuiltInDocumentProperties, CustomDocumentProperties makes the process simple for metadata management.

Managing Built-in Properties

For managing system-defined 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 .

C# Code to Manage Builtin Properties
 

Managing Custom Defined Properties

For managing user-defined properties, API provides CustomDocumentProperties , and developers can easily access already added properties as well as add new properties. In order to add custom properties, 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.

C# Code to Add Metadata in Excel File
C# Code to Remove Custom Property in Excel File