Skip to content

SyncfusionExamples/XlsIO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

5 Easy Ways to Protect Excel Data in C#

Syncfusion® Excel Library (XlsIO) provides various options to easily protect and unprotect Excel documents in C# and VB.NET. This repository contains multiple projects that demonstrate how to secure workbooks and worksheets, apply encryption, lock cells, and mark files as final. These samples are practical references for developers who want to safeguard sensitive data, enforce read‑only restrictions, or automate protection features without relying on Microsoft Excel.

What this repository includes

  • Encrypt-Excel: Shows how to apply a password to an Excel workbook so that it cannot be opened without authorization.
  • Decrypt-Excel: Demonstrates how to remove a password from an encrypted workbook programmatically.
  • Protect-Workbook: Illustrates how to protect the workbook structure and windows with a password.
  • UnProtect-Workbook: Explains how to remove workbook protection when the correct password is provided.
  • Protect-Worksheet: Demonstrates how to protect individual worksheets with multiple options such as locking cells, formatting restrictions, and more.
  • UnProtect-Worksheet: Shows how to unprotect a worksheet using the assigned password.
  • Locked-Cells: Explains how to lock or unlock specific cells so that users can edit only permitted ranges.
  • Mark-As-Final: Demonstrates how to mark a workbook as final, discouraging further edits.
  • ReadOnly: Shows how to recommend a workbook be opened in read‑only mode to prevent accidental changes.

Prerequisites

  • Visual Studio
  • .NET Framework / .NET
  • Syncfusion XlsIO NuGet package

How to run the project

  • Checkout this project to a location in your disk.
  • Open the solution file using the Visual Studio.
  • Run the desired project to generate the output Excel files in the Output folder.
  • Open the generated files to verify the applied protection or unprotection technique.

Use cases

  • Encrypting confidential reports before sharing.
  • Restricting edits to specific worksheets or cells.
  • Automating workbook protection in enterprise workflows.
  • Ensuring that distributed Excel files remain consistent and tamper‑free.
  • Providing end users with read‑only or final versions of reports.

Blog reference

5 Easy Ways to Protect Excel Data in C#

About

This repository contains the examples of creation, reading, editing, and converting Excel files using Syncfusion XlsIO.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages