How to unlock xlsm file
Sheetize XLSM Unlocker for .NET provides a simple yet powerful API for removing password protection from an Excel macro‑enabled workbook while preserving all worksheets, charts, and formatting. This is useful when you need to access a file that was previously secured before sharing it or integrating it into pipelines that require an unlocked workbook.
Main Features
Unlock XLSM Files
Decrypt an existing XLSM file with the correct password. The unlock operation restores full editing capabilities, allowing you to modify macros, formulas, and data.
Preserve Formatting & Objects
All cell styles, formulas, tables, charts, macros, and images remain intact after the unlock process.
Streaming Support
Unlock large workbooks in a streaming fashion to keep memory usage low, ideal for batch processing of many files.
Detailed Instructions
XLSM Unlock Workflow
To unlock an XLSM file with Sheetize, follow these steps:
- Initialize the Unlocker: Create an instance of
SpreadsheetUnlocker. - Configure Options: Set
UnlockerLoadOptionswith the source file path and the password used to protect the workbook. - Define Output Path: Provide the destination path where the unlocked XLSM will be saved.
- Execute Unlock: Call
Processwith the prepared load and save options.
Example – Unlock an XLSM file with a password
using Sheetize;
var loadOptions = new UnlockerLoadOptions
{
InputFile = \"Financial_report.xlsm\",
Password = \"MySecretPwd\"
};
var saveOptions = new SaveOptions
{
OutputFile = \"C:\\\\Unlocked\\\"
};
SpreadsheetUnlocker.Process(loadOptions, saveOptions);Example – Unlock an XLSM file with a write‑protection password
using Sheetize;
var loadOptions = new UnlockerLoadOptions
{
InputFile = \"Macro_enabled_workbook.xlsm\",
PasswordOfWriteProtection = \"WriteProtectPwd\"
};
var saveOptions = new SaveOptions
{
OutputFile = \"D:\\\\Unlocked\\\"
};
SpreadsheetUnlocker.Process(loadOptions, saveOptions);Expanded Format Support
- Sheetize can also unlock CSV, TSV, and HTML exports that were previously protected (the resulting files are provided without encryption).
With these capabilities, Sheetize makes XLSM unlocking effortless, whether you need a quick one‑off script or a production‑grade service that processes thousands of macro‑enabled spreadsheets daily.