For Writing to the Same sheet or overwrite the data existing, sometimes the data to be written is lesser than the ones present in the Excel sheet. In these cases, we would require to clear the sheet contents at first and then write the Data to the sheet.
For this one of the methods is mentioned below :
We could also create empty rows and add/append the empty rows to the Datatable according to the total rows present in the Existing sheet and then write the datatable to the same sheet. Topics related to creating empty rows :