Class SpreadsheetLocker

Info

Locks spreadsheet file

public class SpreadsheetLocker

Inheritance

objectSpreadsheetLocker

Inherited Members

Examples

[C#]
private class MyLockerSaveOptions : LockerSaveOptions
{
    public override ProtectionSettings GetPasswordOfWorksheetProtection(SplitPartInfo info)
    {
        if (info.SheetName == "ToProtect")
        {
            ProtectionSettings ps = new ProtectionSettings();
            ps.Password = "123456";
            ps.ProtectionType = ProtectionType.All;
            return ps;
        }
        return null;
    }
}
SpreadsheetLocker processor = new SpreadsheetLocker();
LoadOptions loadOptions = new LoadOptions();
loadOptions.InputFile = "Template.xlsx";
MyLockerSaveOptions saveOptions = new MyLockerSaveOptions();
saveOptions.Password = "password to lock file";
saveOptions.OutputFile = "res_locked.xlsx";
SpreadsheetLocker.Process(loadOptions, saveOptions);

Methods

Process(LoadOptions, LockerSaveOptions)

.

public static void Process(LoadOptions loadOptions, LockerSaveOptions saveOptions)

Parameters

Remarks

The re-saved file after being locked will always have the same format with the source file.

Namespace: Sheetize Assembly: Sheetize.dll