/// <summary> /// Adds a new row at the bottom of the Excel editing range. /// </summary> /// <param name="clearColoringOfOldNewRow">Flag indicating whether the previous row that was placeholder for new rows is cleared of its formatting.</param> /// <returns>An Excel range containing just the newly added row.</returns> private ExcelInterop.Range AddNewRowToEditingRange(bool clearColoringOfOldNewRow) { EditingWorksheet.UnprotectEditingWorksheet(EditingWorksheet_Change, WorksheetProtectionKey); _editDataRange = _editDataRange.AddNewRow(clearColoringOfOldNewRow, out var newRowRange); EditingWorksheet.ProtectEditingWorksheet(EditingWorksheet_Change, WorksheetProtectionKey, _editDataRange); _editingRowsQuantity = _editDataRange.Rows.Count; return(newRowRange); }
/// <summary> /// Protects the edit dialog's worksheet. /// </summary> public void ProtectWorksheet() { EditingWorksheet.ProtectEditingWorksheet(EditingWorksheet_Change, WorksheetProtectionKey, _editDataRange); }