This article describes how to display document properties in Excel using C#. It has the details to set the IDE for working with this feature, a list of steps to accomplish the task, and a sample code displaying the Excel file properties using C#. You will learn to access the built-in and custom properties using different types of arguments.
Steps to Display Document Properties in Excel using C#
- Set the IDE to use Aspose.Cells for .NET to read properties
- Load the Excel file into the Workbook class to display the properties
- Loop through all the custom document properties in the workbook
- Display the property names and values
- Iterate through all the builtin properties and display name and values
- Access various properties using property name or index
These steps summarize how to display document properties in Excel using C#. Load the source Excel file, parse through all the custom/built-in properties, and display a few features like name and value. Access individual properties using the property name or index as per the requirements.
Code to Show Excel Document Properties using C#
This sample code has demonstrated how to display properties in Excel using C#. Note that custom properties will be displayed if available in the Excel files, however, the built-in properties are always displayed. To access the individual property, you can use any of the other built-in properties say, Author, LastSavedBy, CreateTime, LastSavedTime, and Version, to list a few.
This article has taught us to access and display the properties in an Excel file. To unhide an Excel sheet, refer to the article on how to unhide Excel sheet using C#.