Extract Metadata from Excel Spreadsheets in C# .NET
Extract Metadata from Excel Spreadsheets in C# .NET
Leave feedback
On this page
Extract Metadata from Excel Spreadsheets in C# .NET
Microsoft Excel files often contain hidden metadata such as the author, company, creation date, last modification time, and more. With GroupDocs.Parser for .NET, you can easily extract this metadata from Excel spreadsheets (.xls and .xlsx) using the GetMetadata method.
This guide explains how to extract Excel file metadata programmatically in just a few steps.
What Metadata Can Be Extracted?
The GetMetadata method allows you to access a wide range of Excel spreadsheet properties:
Metadata Field
Description
title
Spreadsheet title
subject
Spreadsheet subject
keywords
Spreadsheet keywords
comments
User comments
content-status
Status of the spreadsheet
category
Spreadsheet category
company
Company name
manager
Manager name
author
Original author
last-author
Last modified by
hyperlink-base
Base URL for relative hyperlinks
application
Application used to create the file
application-version
Version of the application
template
Template name
created-time
Creation time
last-saved-time
Last saved timestamp
last-printed-time
Last printed timestamp
revision-number
Revision number
total-editing-time
Total editing time (in minutes)
Warning
GetMetadata method returns null value if metadata extraction isn’t supported for the document. For example, metadata extraction isn’t supported for CSV files. Therefore, for CSV file GetMetadata method returns null. If Microsoft Office Excel spreadsheet has no metadata, GetMetadata method returns an empty collection.
How to Extract Excel Metadata in C#
Follow these steps to extract metadata from an Excel file:
Instantiate the Parser object for the Excel spreadsheet.
Call the GetMetadata method to retrieve all metadata items.
Iterate through the collection and print metadata names and values.
// Load the Excel fileusing(Parserparser=newParser(filePath)){// Extract metadataIEnumerable<MetadataItem>metadata=parser.GetMetadata();// Iterate through metadata itemsforeach(MetadataItemiteminmetadata){Console.WriteLine($"{item.Name}: {item.Value}");}}
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full featured .NET library we provide simple, but powerful free Apps.
You are welcome to parse documents and extract data from PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Parser App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.