IRONSOFTWAREHOME

How to Edit Excel Workbook Metadata in C#

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Edit Excel metadata in C# using IronXL's Metadata property to programmatically set author, title, keywords, and other document properties without Microsoft Interop, enabling automated spreadsheet organization and searchability.

Metadata for an Excel spreadsheet includes information about the title, author, subject, keywords, creation date, modification date, and other relevant details. Metadata provides context and helps in organizing and categorizing spreadsheets. It simplifies file search and management, especially when working with multiple spreadsheet files. Whether you're creating new spreadsheets or loading existing workbooks, IronXL makes metadata management seamless.

Quickstart: Edit workbook metadata in one easy step

Set, modify, and save properties like Title, Author, or Keywords using IronXL's Metadata interface. No need for Interop - get started instantly with just a few lines of clean, intuitive C# code.

  1. 1Install IronXL with NuGet Package Manager

    PM > Install-Package IronXL.Excel

  2. 2Copy and run this code snippet.

    WorkBook workBook = WorkBook.Load("input.xlsx");
    workBook.Metadata.Title = "Financial Summary";
    // Then save your update to a new file
    workBook.SaveAs("output.xlsx");
    C#
  3. 3Deploy to test on your live environment

    Start using IronXL in your project today with a free trial
    arrow pointer

How Do I Edit Workbook Metadata Properties?

To edit the author name of a spreadsheet file, set the Author property with the desired string of data. For example, workBook.Metadata.Author = "Your Name". The metadata information available in the Metadata property of WorkBook class can be accessed and retrieved. This approach works seamlessly with various spreadsheet file types including XLSX, XLS, and CSV formats.

Which Properties Can I Modify Programmatically?

using IronXL;
using System;

WorkBook workBook = WorkBook.Load("sample.xlsx");

// Set author
workBook.Metadata.Author = "Your Name";
// Set comments
workBook.Metadata.Comments = "Monthly report";
// Set title
workBook.Metadata.Title = "July";
// Set keywords
workBook.Metadata.Keywords = "Report";

// Read the creation date of the excel file
DateTime? creationDate = workBook.Metadata.Created;

// Read the last printed date of the excel file
DateTime? printDate = workBook.Metadata.LastPrinted;

workBook.SaveAs("editedMetadata.xlsx");

For more complex scenarios, you can combine metadata editing with other Excel operations. Here's a comprehensive example that demonstrates batch processing of multiple Excel files:

using IronXL;
using System;
using System.IO;

public class BatchMetadataProcessor
{
    public static void ProcessFinancialReports(string folderPath)
    {
        // Get all Excel files in the directory
        string[] excelFiles = Directory.GetFiles(folderPath, "*.xlsx");
        
        foreach (string filePath in excelFiles)
        {
            // Load the workbook
            WorkBook workBook = WorkBook.Load(filePath);
            
            // Update metadata based on file content
            string fileName = Path.GetFileNameWithoutExtension(filePath);
            
            // Set consistent metadata across all reports
            workBook.Metadata.Author = "Finance Department";
            workBook.Metadata.Company = "Your Company Name";
            workBook.Metadata.Category = "Financial Reports";
            
            // Set dynamic metadata based on filename
            if (fileName.Contains("Q1"))
            {
                workBook.Metadata.Title = "Q1 Financial Report";
                workBook.Metadata.Keywords = "Q1, Finance, Quarterly";
            }
            else if (fileName.Contains("Q2"))
            {
                workBook.Metadata.Title = "Q2 Financial Report";
                workBook.Metadata.Keywords = "Q2, Finance, Quarterly";
            }
            
            // Add timestamp to comments
            workBook.Metadata.Comments = $"Processed on {DateTime.Now:yyyy-MM-dd HH:mm}";
            
            // Set the subject based on worksheet content
            WorkSheet sheet = workBook.DefaultWorkSheet;
            workBook.Metadata.Subject = $"Report containing {sheet.RowCount} data rows";
            
            // Save with updated metadata
            string outputPath = Path.Combine(folderPath, "processed", fileName + "_updated.xlsx");
            workBook.SaveAs(outputPath);
        }
    }
}

What Happens to Existing Metadata When I Save?

When you save or export Excel files using IronXL, any metadata properties you haven't explicitly modified retain their original values. Only the properties you've changed will be updated in the saved file. This selective update approach ensures that valuable existing metadata isn't accidentally lost during processing. The image below shows how metadata appears in Excel's document properties panel after being edited with IronXL:

Excel document properties panel showing edited metadata fields including Author, Title, Subject, and Keywords after modification with IronXL

If you need to clear existing metadata before setting new values, simply assign empty strings or null values to the properties you want to reset. This is particularly useful when preparing documents for external distribution where you want to remove internal company information.


What Metadata Fields Are Available in IronXL?

Not all metadata properties can be edited. Some properties can only be retrieved. Understanding which properties support different operations is crucial for effective metadata management. When working with password-protected workbooks, metadata can still be accessed and modified after the workbook is successfully decrypted.

Which Properties Support Read and Write Operations?

PropertyDescriptionOperationsCommon Use Cases
AuthorDocument creator nameSet, Modify, RetrieveTracking document ownership, compliance
CommentsAdditional notes about the documentSet, Modify, RetrieveVersion notes, processing instructions
LastPrintedDate/time of last print operationSet, Modify, RetrievePrint history tracking, audit trails
KeywordsSearchable keywordsSet, Modify, RetrieveDocument categorization, search optimization
CategoryDocument category classificationSet, Modify, RetrieveFile organization, departmental sorting
CreatedDocument creation dateSet, Modify, RetrieveDocument age tracking, archival decisions
ModifiedLast modification dateSet, Modify, RetrieveChange tracking, version control
SubjectDocument subject descriptionSet, Modify, RetrieveContent summarization, quick identification
TitleDocument titleSet, Modify, RetrieveDocument identification, reporting

Which Properties Are Read-Only?

PropertyDescriptionTypical Values
ApplicationNameName of the application that created the file"Microsoft Excel", "IronXL"
CustomPropertiesUser-defined custom propertiesVaries by document
CompanyCompany name associated with the documentOrganization name from system
ManagerManager name from document propertiesRetrieved from original file
TemplateTemplate used to create the documentTemplate filename or "Normal"

For advanced metadata operations and complete API documentation, refer to the IronXL API Reference. If you encounter any issues with metadata handling, consult our troubleshooting guides or explore licensing options for production deployments.

Frequently Asked Questions

How can I edit metadata of an Excel workbook using C#?

You can edit the metadata of an Excel workbook in C# using IronXL's `Metadata` property. This allows you to set properties such as `author`, `title`, and `keywords` programmatically without needing Microsoft Interop.

What metadata properties can be modified with IronXL?

With IronXL, you can modify several metadata properties like `Author`, `Title`, `Keywords`, `Comments`, `Category`, `Created`, `Modified`, `Subject`, and `LastPrinted`. These provide valuable information to help organize and categorize spreadsheets.

Is it possible to modify metadata without changing other properties in the spreadsheet?

Yes, when modifying metadata with IronXL, only the properties you explicitly change are updated. All other properties retain their original values, ensuring valuable information isn't accidentally lost during processing.

Can IronXL handle metadata for multiple spreadsheet formats?

IronXL supports metadata handling for multiple spreadsheet formats, including `XLSX`, `XLS`, and `CSV`, making it versatile for different use cases and file types.

What are the steps to edit workbook metadata using IronXL?

To edit workbook metadata using IronXL, you need to load the workbook, access the `Metadata` property to set or modify values, and then save the updated workbook.

Do I need Microsoft Interop to modify Excel metadata with IronXL?

No, IronXL allows you to modify Excel metadata programmatically without requiring Microsoft Interop, simplifying the process with clean and intuitive C# code.

How does IronXL handle metadata for password-protected workbooks?

IronXL can access and modify metadata for password-protected workbooks once they are successfully decrypted, allowing secure handling while maintaining data privacy.

What happens if I want to clear existing metadata before saving?

To clear existing metadata before saving, you can assign empty strings or null values to the metadata properties you want to reset, which is useful for preparing documents for external distribution.

Can metadata be updated based on the dynamic content of a file?

Yes, IronXL allows you to set dynamic metadata based on file content or existing file properties, making it adaptable for batch processing or specific content conditions.

Are there any properties in IronXL that are read-only?

Yes, certain properties like `ApplicationName`, `CustomProperties`, `Company`, `Manager`, and `Template` are read-only and cannot be modified through IronXL.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 2,237,574Version:2026.9just released

Get your FREE

30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required
bullet_testTest in production
without watermarks
bullet_calendar30 days fully
functional product
bullet_support24/5 technical
support during trial
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronXL.Excel
nuget.org/packages/IronXL.Excel/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronXL"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

  1. Download and unzip IronXL to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronXL.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required