我正在使用IXLWorksheet.CopyTo
方法将工作表从一个工作簿复制到另一个工作簿,并且未复制保护选项。我认为这是设计使然,但我需要复制它们。
private void CopyProtectionOptions(IXLSheetProtection source, IXLSheetProtection target)
{
target.AutoFilter = source.AutoFilter;
target.DeleteColumns = source.DeleteColumns;
target.DeleteRows = source.DeleteRows;
target.FormatCells = source.FormatCells;
target.FormatColumns = source.FormatColumns;
target.FormatRows = source.FormatRows;
target.InsertColumns = source.InsertColumns;
target.InsertHyperlinks = source.InsertHyperlinks;
target.InsertRows = source.InsertRows;
target.Objects = source.Objects;
target.PivotTables = source.PivotTables;
target.Scenarios = source.Scenarios;
target.SelectLockedCells = source.SelectLockedCells;
target.SelectUnlockedCells = source.SelectUnlockedCells;
}
有没有更好的方法,然后“手动”复制每个标志?