Skip to content

DeleteRow.cs

Avrigeanu Laurian edited this page Apr 12, 2023 · 1 revision

DeleteRow(object sheet, int row, XlDeleteShiftDirection direction)

Parameters

  • sheet : The name or index of the worksheet containing the row to be deleted.
  • row : The row number to be deleted.
  • direction : Specifies the direction in which the cells should be shifted up or left after deleting the row.

Returns

  • A string indicating the row that has been deleted.

Remarks

  • This method deletes the entire row specified by the row parameter in the worksheet specified by the sheet parameter.
  • The direction parameter specifies the direction in which the cells should be shifted up or left after deleting the row.
  • The sheet parameter can be either the name or the index of the worksheet containing the row to be deleted.
  • This method throws an exception if the sheet parameter is not a valid worksheet name or index, or if the row parameter is not a valid row number.

DeleteRowModern(object sheet, int row, XlDeleteShiftDirection direction)

Parameters

  • sheet : The name or index of the worksheet containing the row to be deleted.
  • row : The row number to be deleted.
  • direction : Specifies the direction in which the cells should be shifted up or left after deleting the row.

Returns

  • A string indicating the row that has been deleted.

Remarks

  • This method deletes the entire row specified by the row parameter in the worksheet specified by the sheet parameter.
  • The direction parameter specifies the direction in which the cells should be shifted up or left after deleting the row.
  • The sheet parameter can be either the name or the index of the worksheet containing the row to be deleted.
  • This method is similar to the DeleteRow method, but it releases the COM objects used by the method before returning.
  • Releasing the COM objects is important to avoid memory leaks and improve performance when working with large Excel workbooks.
  • This method throws an exception if the sheet parameter is not a valid worksheet name or index, or if the row parameter is not a valid row number.
Clone this wiki locally