Class SpreadsheetLocker
Info
Locks spreadsheet file
public class SpreadsheetLocker
Inheritance
Inherited Members
- object.GetType(),
- object.MemberwiseClone(),
- object.ToString(),
- object.Equals(object?),
- object.Equals(object?, object?),
- object.ReferenceEquals(object?, object?),
- object.GetHashCode()
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
loadOptions
LoadOptions: Options for input and loading:saveOptions
LockerSaveOptions: Options for output and saving
Remarks
The re-saved file after being locked will always have the same format with the source file.
Namespace: Sheetize Assembly: Sheetize.dll